View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default How to add conditions to an if statement

=IF(F1026,IF(M10<110,"FAIL",IF(M10<150,"3rd Class",IF(M10<200,"2nd
Class","1ST CLASS"))),IF(F10<26,IF(M10<135,"FAIL",IF(M10<175," 3rd
Class",IF(M10<225,"2nd Class","1ST CLASS"))),"Undefined"))
as you still haven't defined the results for all conditions (such as if
F10=26).

If you want F10=26 to be grouped with one of the other groups you could try
either
=IF(F1026,IF(M10<110,"FAIL",IF(M10<150,"3rd Class",IF(M10<200,"2nd
Class","1ST CLASS"))),IF(M10<135,"FAIL",IF(M10<175,"3rd
Class",IF(M10<225,"2nd Class","1ST CLASS")))) or
=IF(F10=26,IF(M10<110,"FAIL",IF(M10<150,"3rd Class",IF(M10<200,"2nd
Class","1ST CLASS"))),IF(M10<135,"FAIL",IF(M10<175,"3rd
Class",IF(M10<225,"2nd Class","1ST CLASS"))))
--
David Biddulph

"Desdinova" wrote in message
...
ok, i figured it all out, but now im running into another problem: i can
only
have 7 functions nested, and i need to write 8. this is the formula:
=IF(AND(F626,M6<110),"FAIL",IF(AND(F6<26,M6<135), "FAIL",IF(AND(F626,M6<150),"3rd
Class",IF(AND(F6<26,M6<175),"3rd Class",IF(AND(F626,M6<200),"2nd
Class",IF(AND(F6<26,M6<225),"2nd Class", IF(AND(F626,M6=200),"1ST
CLASS",IF(AND(F6<26,M6=225),"1ST CLASS"))))))))

it works all the way up until the eighth nested function, and then it wont
work. is there any way to rewrite it? thanks for the help!

"David Biddulph" wrote:

Look at Excel help for the syntax of the AND() function, then use that
AND()
function as the condition part of your IF() function.

Also, don't forget to specify the alternative output for when your IF()
condition is NOT satisfied. If you don't specify an output, it will
default
to the Boolean FALSE, which may not be the output you want.
--
David Biddulph

"Desdinova" wrote in message
...
ok, for some reason i cannot write a new post (maybe i can only have
one?).
So i will ask it he how can i add to an "if" function. As in, i want
to
say =IF M626 AND T6<135, "1st class"

can i do this, and effectively add two conditions for one if statement?