Extract fraction as a whole number

YasserKhalil

Well-known Member
Joined
Jun 24, 2010
Messages
852
Hello
I want to extract just the fraction as a whole numer even if the fraction has a zero at its end
Example
16.1500 - 12.140 - 10.01 - 60.0060

The results should be

1500 - 140 - 01 - 0060
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
The problem with the whole scheme is that is is entirely text based. If we try to do this with numbers, since 014 = 14 there is no way to tell the difference between the results of 3.014 and 3.14.

If you want this to work with numbers, change the goal to something like "number of ten thousandths" rather than "fractional part as whole number"
 
Upvote 0
Different formats sir
I know it is weird but these values formatted diffenetly not the same
So you are saying each cell is formatted individually with no regard to the formatting used on neighboring cells. Okay, see if this formula works for you...

=LEFT(MID(F1,FIND(".",F1&".")+1,99)&"000000000000000",MID(CELL("Format",F1),2,2))
 
Upvote 0
Yeah, the trailing zeros are a bit tricky. You might want to try out this one:

=+CONCATENATE(MID(A1;FIND(".";A1)+1;LEN(A1));REPT("0";MAX(0;MID(CELL("format";A1);2;1)-LEN(MID(A1;FIND(".";A1)+1;LEN(A1))))))

Assuming that cell A1 has a properly formatted number, that has a fraction part. Otherwise it will yell. Ugly as hell.

Looking forward to Your feedback!

Regards, Balázs
 
Upvote 0
So you are saying each cell is formatted individually with no regard to the formatting used on neighboring cells. Okay, see if this formula works for you...

=LEFT(MID(F1,FIND(".",F1&".")+1,99)&"000000000000000",MID(CELL("Format",F1),2,2))
Works like a charm
Thanks a lot for your great help
Thank you very much Mr. Rick
 
Upvote 0
Yeah, the trailing zeros are a bit tricky. You might want to try out this one:

=+CONCATENATE(MID(A1;FIND(".";A1)+1;LEN(A1));REPT("0";MAX(0;MID(CELL("format";A1);2;1)-LEN(MID(A1;FIND(".";A1)+1;LEN(A1))))))

Assuming that cell A1 has a properly formatted number, that has a fraction part. Otherwise it will yell. Ugly as hell.

Looking forward to Your feedback!

Regards, Balázs

Thank you sir for your helpful formula.. It is very good with decimals only but with the numbers without fractions returns Value error
 
Upvote 0
UDF?

Code:
Function YK(r As Range) As String
    Dim s As String

    s = r(1).Text
    If InStr(s, ".") Then YK = Mid(s, InStr(s, ".") + 1)
End Function

Row\Col
A​
B​
C​
1​
16.1500​
1500B1: =yk(A1)
2​
-12.140​
140
3​
-10.01​
01
4​
-60.0060​
0060
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,673
Members
449,463
Latest member
Jojomen56

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