Nested If Statement

  • Thread starter Thread starter Tyrone
  • Start date Start date
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 :
 
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
 
Back
Top