Nested If Statement

T

Tyrone

I am having trouble with this formula. I need it to return a 0 when th
answer is "N", not a "False". Can you tell me what I am doing wrong?

=IF(AND(LEFT($I$39,1)<>"N"),"",IF(AND(LEFT($I$39,1)<>"Y"),"invalid",IF(AND($I$39="YES"),5,0)))

Thanks for your help :
 
T

Trevor Shuttleworth

Tyrone

what exactly are you testing for ? Could you spell it out in words rather
than the formula that doesn't work. Some examples would be useful. The
ANDs are all redundant:

=IF(LEFT($I$39,1)<>"N","",IF(LEFT($I$39,1)<>"Y","invalid",IF($I$39="YES",5,0
)))

returns the same result ... albeit wrong

Maybe this is closer to what you want:

=IF(LEFT($I$39,1)="N",0,IF(LEFT($I$39,1)<>"Y","invalid",IF($I$39="YES",5,0))
)

Regards

Trevor
 

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