Multiple IF Statements


Posted by Jamie on March 27, 2000 2:07 PM

Hi all,
In excel 97, I'd like to setup a cell for multiple IF statements but I can't figure it out and it's driving me nuts. I'd like a formula to understand this sentence:
If A1=1, then insert the contents of cell B1, or, if A1=2, then insert the contents of cell C1, or, if A1=3, then insert the contents of cell D1, or, if A1=4, then insert the contents of cell E1.
A1 will always equal either 1, 2, 3, or 4 so I really don't need an "if false" line.
Can anyone help save my sanity?
Any and all help will be greatly appreciated.
Thanks,
Jamie

Posted by Jaime on March 27, 2000 2:24 PM

This will help


=B1*(A1=1)+C1*(A1=2)+D1*(A1=3)+E1*(A1=4)

Jaime

Posted by Jamie on March 27, 2000 3:12 PM

Thanks

Jaime,
thanks a million, that really helped.



Posted by Jim Stevens on June 01, 2000 1:50 PM

This solution is great but what do I do if I want to test two conditions (from your example, B1 IF(A1=1 AND A2=1), C1 IF (A1=1 AND A2=2), etc.?

=B1*(A1=1)+C1*(A1=2)+D1*(A1=3)+E1*(A1=4)

Jim