If Function

  • Thread starter Thread starter Victor Waller
  • Start date Start date
V

Victor Waller

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
 
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
 

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

Back
Top