# IF not displaying what I expect

#### Nite0wls

##### New Member
Hi all, I have a problem with the IF function

The cell is a numeric value of 144289039636759
When the starting value of the number is 1 then I want only a part of the value 4428903963
If it is not then I expect the whole value.

This is the formula I use

=IF(LEFT(A13215,1=1),VALUE(MID(A13215,2,10)),A13215)

The VALUE(MID(A13215,2,10)) in itself returns the right value when I use it in a cell:
=VALUE(MID(A13215,2,10))

But the IF statement throws a #VALUE! error
I removed the VALUE but it still throws the error.

I know that the MID is original text manipulator but in many articles it is mentioned as to be able to use for numbers too

Is there a way to get part of the digits from a number to use?

### Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Perhaps

=IF(LEFT(A13215,1)="1",VALUE(MID(A13215,2,10)),A13215)

This part LEFT(A13215,1=1)

Should be LEFT(A13215,1)="1"

That's what I was going to suggest.

Thanks all, the "1" part was the issue.

Ben thanks for the suggestion on that part as well.

You're welcome.

Replies
4
Views
144
Replies
1
Views
314
Replies
1
Views
252
Replies
4
Views
429
Replies
9
Views
490

1,221,185
Messages
6,158,407
Members
451,490
Latest member
desktopace

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back