View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AKphidelt AKphidelt is offline
external usenet poster
 
Posts: 461
Default IF Function with ISBLANK

Try something like this

=If(Len(A1)<1,"",If(Right(A1,1)="x",4,If(Right(A1, 1)="z",8,"Error")))

"Steve M" wrote:

Hello,
I'm hoping someone can figure this out. I am trying to add a value to
B1 using the following:
I started out with =IF(ISBLANK(A1),"",8)
A1 will either be blank or contain a date. As an example I want to
change the above so that if I enter in A1 the date of May-7x the the
value in B1 will return a 4. And if I enter the date of May-7z into
A1 then the value returned in B1 should be 8.

So to summarize, B1 should either be blank, contain a 4 or contain an
8. I think the key is that I need to define a wild card (if possible)
to look for either the 'x' at the end of the date to bring back '4' or
a 'z' at the end of the date to bring back an '8'.

Its a bit confusing to explain, hopefully you can understand.

-Thanks