Archive of Mr Excel Message Board

Back to Forms in Excel VBA archive index
Back to archive home

"IF,THEN FUNCTION" Question
Posted by Rich wong on December 03, 2001 3:47 PM
To anybody out there....
I have a question concerning the usage of "If,Then" functions in Excel. I understand how to use the basic form of this function. However, if I want two conditions (instead of one), how would I write it?
More specifically, I have two cells, B3 and C3. I want it so the difference of C3-B3 will yield "YES", if the number is greater than 5, and "NO" for all other answers. HOWEVER, I ALSO, want the condition "YES" tied also to the value of B3 ALSO being greater than 50.
Confused? Well, without the second condition (greater than 50), I would simply have:
=If((C3-B3)>5,"YES","NO")
But now, I want to include the second condition of B3 also being greater than 50. THIS IS WHERE I'M STUCK.
Any help would be appreciated.
Thanks.

| Check out our Excel Resources
|
 |
 |
Re: "IF,THEN FUNCTION" Question
Posted by IML on December 03, 2001 4:52 PM
How about
=IF(OR(C3-B3>5,B3>50),"yes","no")
good luck

Re: "IF,THEN FUNCTION" Question
Posted by Tom D. on December 03, 2001 9:19 PM
Not sure if you want to use "OR" or "AND". "OR" will result in a "YES" if either condition is true, "AND" will require both conditions to be true for a "YES" answer.

IML AND TOM D... : THANKS A BUNCH. IT WORKED!
Posted by RICH on December 04, 2001 6:36 AM

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.