Problems with IF-function...

[Closed]
Report
Posts
1
Registration date
Sunday March 10, 2013
Status
Member
Last seen
March 10, 2013
-
Posts
42
Registration date
Thursday January 31, 2013
Status
Member
Last seen
April 26, 2014
-
Hello,

I'm using Excel 2003 (yes, still) and I'm having trouble with the IF function.
I have a 13-digit number in E2, and in F2 I want the function to say "yes" if the 10th digit is 5.

The value in E2 is: 1211990335073
So I've tried using: =IF(MID(E2;10;1)=5;"yes";"no"). So obviously, it should say yes, but it doesn't. What am I doing wrong?


2 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
MID returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.

You mid return is a string
=IF(MID(E2;10;1)="5";"yes";"no").
Posts
42
Registration date
Thursday January 31, 2013
Status
Member
Last seen
April 26, 2014
9
Hi MouseBouse

Another version, which could be used.

=IF(--MID(A1,9,1)=5,"yes","no")

Kevin