IF not displaying what I expect

Nite0wls

New Member
Joined
May 21, 2014
Messages
33
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
That's what I was going to suggest.

I would just add =IF(LEFT(A13215,1="1"),VALUE(MID(A13215,2,10)),VALUE(A13215))
 
Upvote 0
Thanks all, the "1" part was the issue.

Ben thanks for the suggestion on that part as well.
 
Upvote 0

Forum statistics

Threads
1,225,481
Messages
6,185,246
Members
453,283
Latest member
Shortm88

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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