IF & AND function

R

Ron Coderre

If you post an example of what you are trying to do, I'm sure you'll get an
answer that is more tailored to what you need.

***********
Regards,
Ron

XL2002, WinXP-Pro
 
T

Tom Ogilvy

=IF(A1<5,"",IF(AND(A1>=5,A1<10),"A",IF(AND(A1>=10,A1<15),"B",IF(AND(A1>=15,A
1<20),"C","D"))))

would be an example.

It would be useful to point out that this is a bad example as the evaluation
of the IF function is progressive, so

=if(A1<5,"",if(A1<10,"A",if(A1<15,"B",if(A1<20,"C","D"))))

would be sufficient.

Also, note that you can not nest IF function deeper than 7 levels.

A work around is shown at Chip Pearson's site
http://www.cpearson.com/excel/nested.htm

But usually, if this is a limitation, another method is more appropriate
such as building a lookup table and using Vlookup.
 
Top