Problems with IF-function...

Closed
MouseBouse Posts 1 Registration date Sunday March 10, 2013 Status Member Last seen March 10, 2013 - Mar 10, 2013 at 03:02 PM
Kevin@Radstock Posts 42 Registration date Thursday January 31, 2013 Status Member Last seen April 26, 2014 - Mar 11, 2013 at 01:56 AM
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 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 10, 2013 at 04:25 PM
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").
0
Kevin@Radstock Posts 42 Registration date Thursday January 31, 2013 Status Member Last seen April 26, 2014 9
Mar 11, 2013 at 01:56 AM
Hi MouseBouse

Another version, which could be used.

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

Kevin
0