View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ssciarrino ssciarrino is offline
external usenet poster
 
Posts: 20
Default Problem with my Nested IF, the Else output is incorrect

Ok Here is my nested IF I tabbed it out for better reading.

Basically if the last digit of C12 ends in a value, C13 returns the equivalent

So if C12 ends with

1 then 00 shows on C13
2 then 02 shows on C13
3 then 03 shows on C13
4 then 19 shows on C13
5 then 05 shows on C13
A-Z then 02 shows on C13
[blank] should show [blank]

but blank shows '02'

Here is the formula

=IF(RIGHT(C12,1)="1",TEXT(0,"00"),
IF(RIGHT(C12,1)="2",TEXT(0,"02"),
IF(RIGHT(C12,1)="3",TEXT(0,"03"),
IF(RIGHT(C12,1)="4",TEXT(0,"19"),
IF(RIGHT(C12,1)="5",TEXT(0,"05"),
IF(OR(RIGHT(C12,1)="A",(RIGHT(C12,1))<="Z"),TEXT( 0,"02"),
IF(RIGHT(C12,1)="",TEXT(0,""))))))))

thanks for the help