Minus decimal places from number after 4 decimal places

micfoste10

New Member
Joined
Aug 25, 2015
Messages
9
hi,

I have a number 5133.159699999999 I would like to extract or minus all the digits after the 4th decimal place.

i.e. 99999999 - the problem I have is the list of numbers I need to do this for has differing number of decimal places.

how can I do this please?
 
Unless you mean the result of this.
=MID(A1, FIND(".", A1)+5,99)

That might be sufficient for @micfoste10's purposes. But in that expression, Excel replaces A1 with its form as if formatted as General, but up to 15 significant digits. And for some values, that might be a Scientific form (e.g. 1.23456789012345E-5), not a Number form. And for some values, there might not be any decimal point (e.g. 5133).

(So, at a minimum, it would be prudent to write IFERROR(MID(A1, 5+FIND(".", A1), 99), "0").)

That is why I wrote that it would be nice if we knew the "range and form" of the original values.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
PS....
To that end, you might use the following (A1 is the original value, 5133.15969999999):
=MID(TEXT(A1, "0."&REPT("#",127)), 5+FIND(".", TEXT(A1, "0."&REPT("#",127))), 127)

It might be noted that that does not work as intended for values less than 1E-127. I chose 127 decimal places not for its practicality, but to demonstrate that we can format more than 30 decimal places, a well-known limitation of the Number format.

It might also be noted that my expression returns the null string, not zero, when there are fewer than 4 decimal places. If zero is preferred, use the following formula:

=MID(TEXT(A1, "0.00000"&REPT("#",122)), 5+FIND(".", TEXT(A1, "0.00000"&REPT("#",122))), 127)

That is what I wrote initially. But I had forgotten why, and in the end, I thought the consistent use of 127 would be less confusing.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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