Multiple IF statement

K

Kristen PS

Hi,
I am trying to get a text response within a multiple IFF statement.
Basically, if the value in a cell is between 6 and 9 I want the formula to
return "drier than normal"
Between 10-14, "normal" 15-18 "wetter than normal.
This is the equation I have put together, but it keeps coming back "False"

=IF(AND(B45<9, B45>6), "drier than normal", IF(AND(B45<14, B45>10),"normal",
IF(AND(B45>15,B45<18), "wetter than normal")))
Any suggestions?
Thanks in advance!
Kristen
 
R

Rick Rothstein \(MVP - VB\)

First off, you need to add some equal signs to your > and < symbols (that
is, make them >= and <=); as written, your function will result in an answer
of FALSE for values of 6,9,10,14,15 and 18. You might want to consider
handling the case when a number is outside of your ranges (add a comma and
your message after the "wetter than normal" message). You can also simplify
the look of your formula by taking advantage of the fact that the IF
statements are executed in order...

=IF(B45<6,"Out of Range",IF(B45<10,"Drier than
Normal",IF(B45<15,"Normal",IF(B45<19,"Wetter than Normal","Out of Range"))))

Here, as I have it structured, the equal signs are not required.

Rick
 
T

Teethless mama

=LOOKUP(B45,{0,6,10,15,19},{"undefined","direr than normal","normal","wetter
than normal","undefined"})
 
M

Max

Maybe this:
=IF(AND(B45<=9, B45>=6),"drier than normal",IF(AND(B45<=14,
B45>=10),"normal",IF(AND(B45>=15,B45<=18),"wetter than
normal","out-of-range")))

Ranges were tightened to be continuous (there were gaps),
with an "out-of-range" added for completeness
 
D

David Biddulph

You've still got gaps, Max. There's a gap between 9 and 10, and another
between 14 and 15.
If you are lucky, the value in B45 may have been constrained to be an
integer, but the OP didn't say so.
 
M

Max

Probably subconsciously led-in by the manner in which the OP described it in
the 1st para, David. But you're right that the suggestion could be
waterproofed further against this assumption.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top