1. ## If Statement (2003)

How do you set up a multiple If statement in Excel. I will have 5 Ifs. If(A2=0,"A", if(A2=1,"B",if(A2=2,"C",IF(A2=3,"D",If(A2=4,"E"))) )). This doesn't seem to work. I even tried If(A2=0,"A", if(A2=1,"B",if(A2=2,"C",IF(A2=3,"D","E")))) but no luck. Thanks for your help.

If the nested if doesn't work, how would I set up a Lookup. I tried =B1+Lookup(A1,{"A","B","C","D","E";0,1,2,3,4})

I am not sure what the correct syntax for this is. The data is in say Column A and I want the results in Column B. I tried this and everything results in 0.

2. ## Re: If Statement (2003)

This 2 formula can work for me, Do your entered " = " In front of the formula, as show below :

=IF(A2=0,"A", IF(A2=1,"B",IF(A2=2,"C",IF(A2=3,"D","E"))))

=IF(A2=0,"A", IF(A2=1,"B",IF(A2=2,"C",IF(A2=3,"D",IF(A2=4,"E"))) ))

The other option, you can use CHOOSE instead of IF, because CHOOSE accepted 29 arguments, something like :

=CHOOSE(A2+1,"A","B","C","D","E")

Regards
Bosco

3. ## Re: If Statement (2003)

Those formulas work. I am not sure why they didn't work when I tried them the first time - probably just something I typed wrong.

I do have a question about Choose - I tried that but it only worked if the numbers in column 1 were in order. The 0,1,2,3,4 could be in any order.

4. ## Re: If Statement (2003)

Can you post some examples, together with your expected result.

Regards
Bosco

5. ## Re: If Statement (2003)

You could use th following as well:

=CHAR(A2+65)

6. ## Re: If Statement (2003)

Why doesn't this work =LOOKUP(A1,{"a",0;"b",1;"c",2;"d",4}). In Column A I have numbers 0,1,2,3,4 for say a 1000 records. Numbers are not in any order. In column B I put the Lookup formula but it gives me an N/A error. I looked this up and the example uses a text field where I have A1 - "a". Can't I specify a variable - whatever is in column A?

7. ## Re: If Statement (2003)

Because you are looking up numbers in the letters column. Try this array (confirm with ctrl-shift-enter)

=LOOKUP(A1,{0,"a";1,"b";2,"c";4,"d"})

Steve

8. ## Re: If Statement (2003)

Duh - Thanks. I thought you would put what you wanted first and then the number that represents what you have in column A. I guess not. Thanks for your help.

#### Posting Permissions

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