If Statement

Nay - Nov 14, 2008 at 04:36 AM
 Nay - Nov 17, 2008 at 09:36 PM

I am trying to do an if statement.

if cell a2=10,15,39,47,53,54,63,75,78,77,86,85 then take cell B2x1.5 if not one of those numbers then leave b2 at the number it already is. I am not sure how to do this if statement since there are more then seven nested if statements.

I tried a lookup statement and that did not work right either. I must not be putting comma's and parenthesis in the correct spots.

Can anyone help?


1 reply


Few ways to do it....

nest an OR statement in the IF statement

if(or(a2=10, a2=15,a2=39,etc)=true, b2*1.5, b2)

Other way to use the OR statement is to list 10,15,39,47,53,54,63... in separate cells (say d1 to d10) and use

if(or(d1:d10)=true, b2*1.5, b2)

Also, to use Lookup, again say use d1 to d10, and use lookup(a2, d1:d10), if true will return number, if false will return #N/A, so can also embed this in ISNA

if(isna(lookup(a2, d1:d10))=false, b2*1.5, b2)

There is a few other ways to do too, but either will work

Thanks! You just made my day!!!!! Wow, this will make my job so much easier!!! Oh I can't thank you enough...