Trapshooters Forum banner

Status
Not open for further replies.
1 - 11 of 11 Posts

·
Registered
Joined
·
1,831 Posts
Discussion Starter #1
Hey All,

My current formula reads =IF(B2=33,M2,""). What I want is for the cell to equal M2 if either B2=33 or B2=43. Any help would be appreciated.

Thanks in advance,
Matt Ski
 

·
Registered
Joined
·
4,113 Posts
Paul's second example is the correct formula, although texasaggie's will also return the value of M2 if true.
 

·
Registered
Joined
·
829 Posts
=IF(OR(B2=33,B2=43),M2,"")

=If(expression, if true, if false)

Basically, the equation evaluates the 'expression' to determine if it is true or false. In this case is "OR(B2=33,B2=43)" true or false? I'll go over the 'OR' statement in a minute. If the 'expression' is true, then Excel will use the first value given, in this case the value in cell M2. If the 'expression' is false, then Excel will use the second value of "".

OR(B2=33,B2=43)

If the value in cell B2 = 33 OR 43 then the expression returns a value of 'true', if the value in cell B2 is something other than 33 or 43 then the expression returns a value of 'false'.

=IF(OR(B2=33,B2=43),M2,"")

If the value in cell B2=33 or 43 then use the value in cell M2 in this cell, otherwise leave this cell blank.
 

·
Registered
Joined
·
1,831 Posts
Discussion Starter #10
Thanks to all for your help. I knew there had to be some Excel guru's out there somewhere.

Mitch,
Thanks for the congrats. It wasn't pretty but we got the job done! I learned the secret to winning calcuttas...have a good partner!

Thanks again to EVERYONE!

Matt Ski
 

·
Registered
Joined
·
6,754 Posts
Try =if(b2=33,m2,if(b2=43,m2),""). Nested if statement. If you get into more conditions that this you may want to use the lookup function and a table. Its alot easier to modify and expand.
 
1 - 11 of 11 Posts
Status
Not open for further replies.
Top