Thread: If Function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default If Function

MID returns a string, so you can't compare this directly with a
number. Change your formula to this:

=IF(MID(E57,2,1)="1",RIGHT(E57,1),"x")

(easiest), or this:

=IF(VALUE(MID(E57,2,1))=1,RIGHT(E57,1),"x")

Hope this helps.

Pete

On Mar 10, 12:18 am, "Victor Waller" wrote:
What is wrong about this formula??

=IF(MID(E57,2,1)=1,RIGHT(E57,1),"x")

I have a number 3106 in cell E57. I want the formula to perform the
following:

If the second digit from the left (which is 1) is equal to 1 then I want to
place the last digit (6) into a cell. Else if the second digit is not equal
to 1 then I want to place an X in the cell.

The above formula seems to be the correct choice but I get a VALUE error.

Can anyone tell what's wrong.

Vic