"If" Formula Error

E

evoxfan

Below is the formula I currently have. I want to get a "1" if the logical
test answer returns a number not equal to 2-16 (a range). So if the number is
less than 2 or greater than 16, I need a 1, otherwise I need "Assign
Division".
How do you put "not equal" in a formula and how do you put "not equal" to a
range of numbers?

=IF(MID(D26,2,2)<2>16,1,"Assign Division")

Thanks in advance for your help.
 
S

Sheeloo

Try
=IF(OR((0+MID(D26,2,2))*1<2,(0+MID(D26,2,2)>16)),1,"Assign Division")

0 is added to convert the string returned by MID to a number
 
K

Kassie

MMID checks text, not numbers, so MID will cause a problem. MID(D26,2,2)
cannot return a number less than 2, since you are checking 2 digits. The >
part will also always evaluate to TRUE.

A little magic though, should do the trick. Change your formula to read
=IF(OR(SUM(MID(D26,2,2)+0)<2,SUM(MID(D26,2,2)+0)>16),1,"Assign Division")

--
HTH

Kassie

Replace xxx with hotmail
 
R

Rick Rothstein

I believe this will also work...

=IF(ABS(MID(D26,2,2)-9)>7,1,"Assign Division")
 

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

Top