Can anyone tell me what's wrong with this formula?

L

Linda

Can anyone tell me what's wrong with this formula:
=IF(D5=517,8,IF(D5=520,8,IF(D5=521,8,IF(D5=522,8,IF(D5=523,8,IF(D5=524,8,IF(D5=567,8,IF(D5>24,0,D5))))))))
I get an error message and I do not know why? Please help!
 
B

Bob Phillips

I don't, but it could be simpler

=IF(OR(D5=517,D5=520,D5=521,D5=522,D5=523,D5=524,D5=567),8,IF(D5>24,0,D5))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
D

Dana DeLouis

=IF(D5=517,8,IF(D5=520,8,IF(D5=521...etc

Would this work?

=IF(OR(D5={517,520,521,522,523,524,567}),8,IF(D5>24,0,D5))
 
A

ah

The last part of the formula overides all the other if statements and you
have too many nested if statements, You can only have 7. You could solve this
with a lookup table or here is another way
=IF(OR(D5=517,D5=520,D5=521,D5=522),8,"")
 
C

ChE_maynard

Linda said:
Can anyone tell me what's wrong with this formula:
=IF(D5=517,8,IF(D5=520,8,IF(D5=521,8,IF(D5=522,8,IF(D5=523,8,IF(D5=524,8,IF(D5=567,8,IF(D524,0,D5))))))))
I get an error message and I do not know why? Please help!

Look at the fifth "IF", there's a space between the "I" and the "F".
Hope this it!
maynard
 

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