# How to use an IF statement with multiple outcomes

1. ## How to use an IF statement with multiple outcomes

Hi,

I want to say, if B1 = A then the value is 10, if B1 = B then the value is 20, if C then the value is 30 and D the value is 40.

If there are two conditions then I know it would be =if(b1=A,10,0) but this is obviously a bit more complex.

Thanks

Matt

2. ## Re: How to use an IF statement with multiple outcomes

You can use a nested IF.. like so

=IF(B1="A",10,IF(B1="B",20,IF(B1="C",20,IF(B1="D",40,"")

or simpler and more versatile...

=Lookup(B1,{"A","B","C","D"},{10,20,30,40})

Cheers!

4. ## Re: How to use an IF statement with multiple outcomes

Using the Lookup, how do I put in a line to show "" for any inputs other than A B Cor D?

5. ## Re: How to use an IF statement with multiple outcomes

Try:

=LOOKUP(B1,{"A","B","C","D","E"},{10,20,30,40,""})

6. ## Re: How to use an IF statement with multiple outcomes

In the off chance you might have blank or a number in B1, you could change it to
=LOOKUP(B1,{0,"A","B","C","D","E"},{"",10,20,30,40,""})

7. ## Re: How to use an IF statement with multiple outcomes

Cheers thanks

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1