View Single Post
  #12   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

I don't understand that you say:
"The solution you offered does not include the second age parameter F10<=26"

Isn't that covered in the part of my first formula that says:
"... IF(F10<26,IF(M10<135,"FAIL",IF(M10<175,"3rd Class",IF(M10<225,"2nd
Class","1ST CLASS")))
or in the second half of the 2nd and 3rd formulae where it says:
"... IF(M10<135,"FAIL",IF(M10<175,"3rd Class",IF(M10<225,"2nd Class","1ST
CLASS"))))"
in the path that we get to when we don't satify the initial F1026 test?

Given that you're now saying that F10=26 should be grouped with F10<26, the
formula to use is my second one:
=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"))))

Have you tried that formula? Is it giving results different from what you
wanted?
--
David Biddulph

"Desdinova" wrote in message
...
ok, im obviously not near as advanced as you are, so try not to get
frustrated. the problem is (still), that i have two parameters for four
different formulas, which totals 8 operations. i need to make a
=IF(F1026,
and has a score M10110,"FAIL", but i also need a different age group
=IF(F10<=26, and has a score M10135,"FAIL". but there is also a 1st,2nd,
and
3rd class score for each age group. The way i am trying to do it :
=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"))))))))

works up until the eight nested function, since excel only allows 7. The
solution you offered does not include the second age parameter F10<=26. I
might be missing something very fundamental, so please excuse. And thank
you
again for the help.

"David Biddulph" wrote:

=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?