Nested If

U

ub

Hi
I have an if statement with 5 nested if statments , each if statement
satisfy's more than 1 condition, example :
IF(AND(HOUR(D6)<=HOUR(F6),OR(HOUR(D6)<=20,HOUR(D6)>=8),MINUTE(D6)>MINUTE(F6)),
" Target",
IF(AND(HOUR(D6)<=HOUR(F6),OR(HOUR(D6)<=20,HOUR(D6)>=8),MINUTE(D6)<MINUTE(F6)),"Target not met", another if statement and so on)))
But when I add another if condition, system gives me a message that their is
error in formula. I have checked the formula but their is no error. If I take
one of the if condition, it works.
Please advise how many conditions can I specify in a function and if my
conditions are more, then what is the best way to get the results.

Regards
 
S

stew

ub said:
Hi
I have an if statement with 5 nested if statments , each if statement
satisfy's more than 1 condition, example :
IF(AND(HOUR(D6)<=HOUR(F6),OR(HOUR(D6)<=20,HOUR(D6)>=8),MINUTE(D6)>MINUTE(F6)),
" Target",
IF(AND(HOUR(D6)<=HOUR(F6),OR(HOUR(D6)<=20,HOUR(D6)>=8),MINUTE(D6)<MINUTE(F6)),"Target not met", another if statement and so on)))
But when I add another if condition, system gives me a message that their is
error in formula. I have checked the formula but their is no error. If I take
one of the if condition, it works.
Please advise how many conditions can I specify in a function and if my
conditions are more, then what is the best way to get the results.

Regards
 
S

stew

Sorry Finger Twitch. I know that in Excel 2003 the max no of conditions in IF
is 7, after that you get an error

Best

Stew
 
L

Lorne

ub said:
Hi
I have an if statement with 5 nested if statments , each if statement
satisfy's more than 1 condition, example :
IF(AND(HOUR(D6)<=HOUR(F6),OR(HOUR(D6)<=20,HOUR(D6)>=8),MINUTE(D6)>MINUTE(F6)),
" Target",
IF(AND(HOUR(D6)<=HOUR(F6),OR(HOUR(D6)<=20,HOUR(D6)>=8),MINUTE(D6)<MINUTE(F6)),"Target
not met", another if statement and so on)))
But when I add another if condition, system gives me a message that their
is
error in formula. I have checked the formula but their is no error. If I
take
one of the if condition, it works.
Please advise how many conditions can I specify in a function and if my
conditions are more, then what is the best way to get the results.

depends on excel version. 64 if's cans be nested in Excel 2007. Earlier
version have a lower limit (I think 7)
 

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