Archive of Mr Excel Message Board


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

if statement with multiple conditions

Posted by Blind Ric on January 17, 2001 12:04 PM
I have a number in cells A1 through L1. I am trying to put in a formula into cell B3 that checks the content of cell A3. If A3 equals any of the numbers in cells A1 through L1, it will put the word yes, and it will put the word no otherwise. I tried a huge embedded netwrok of if statements, but it did not work. Anyone have any ideas? Thanks.

Check out our Excel Resources

Re: if statement with multiple conditions

Posted by Steve Riedmueller on January 17, 2001 12:24 PM

Look into the "For Each .. in .." structure... it might be what you need.


Re: if statement with multiple conditions

Posted by Aladin Akyurek on January 17, 2001 12:56 PM

I hope I got your question right.

B3 =IF(COUNTIF(A1:A5,A3)>=2,"Yes","No")

Aladin


Re: if statement with multiple conditions

Posted by Bruce on January 17, 2001 12:59 PM

Try this formula:

=IF(ISNA(HLOOKUP(A3,A1:L1,1,FALSE)),"No","Yes")


Re: if statement with multiple conditions

Posted by Aladin Akyurek on January 17, 2001 1:00 PM

Gone too fast: Change the formula to:

B3 =IF(COUNTIF(A1:L1,A3)>=1,"Yes","No")

Aladin


Re: if statement with multiple conditions

Posted by Mark W. on January 17, 2001 1:34 PM
{=IF(OR(A3=A1:L1),"Yes","No")}

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.