Convert decimal to fraction

BWMagee

Board Regular
Joined
Feb 18, 2014
Messages
112
I need to display the decimal value 1.333333333 as fraction 4/3. However, as I'm using them individually in formulas, the 4 and 3 have to be in separate columns. Therefore simply formatting the cell to display as a fraction is of no use.

There are multiple values that need this treatment, some with large decimal values. My current method is this: In column B I round all values to 8 decimal places. In column C I multiply by 1000000000 to display the numerator without decimal places, and in column D I type 1000000000 as the denominator. This gives B = 1333333330 and C= 1000000000. In order to reduce this fraction to its lowest terms, in column E I type =GCD(B,C) which gives a value 10. Dividing B and C by 10, you can see I do not get the answer 4 and 3.

This approach works perfectly on simple decimals, such as 1.25, 1.5, 1.125... but horribly on repeating decimals, such as 1.33333, 1.2727272727, 1.08333333.

Is there a better way to convert decimals to fractions, or a trick so this process works for repeating decimals?

The formula I am using for the values 4, 3 is =LOG(4*3) or =LOG(B*C). I have tried putting the decimal in. Eg. =LOG(1.3333333*1) but it doesn't return satisfactory results. If anyone knows how to use a decimal instead of a fraction in a logarithmic formula like this it would prevent any need to convert decimal to fraction, and would be the ideal answer. But if that is not possible, then I need to find a way to reduce my decimals to lowest fractions. All help is much appreciated.
 
Anyone? Anyone

in VBA I define the format as Selection.NumberFormat = "# ??/??"
It just looks stupid to display
8/16 rather then 1/2
6/16 rather then 3/8

Help appreciated
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I need to display the decimal value 1.333333333 as fraction 4/3. However, as I'm using them individually in formulas, the 4 and 3 have to be in separate columns. Therefore simply formatting the cell to display as a fraction is of no use.

There are multiple values that need this treatment, some with large decimal values. My current method is this: In column B I round all values to 8 decimal places. In column C I multiply by 1000000000 to display the numerator without decimal places, and in column D I type 1000000000 as the denominator. This gives B = 1333333330 and C= 1000000000. In order to reduce this fraction to its lowest terms, in column E I type =GCD(B,C) which gives a value 10. Dividing B and C by 10, you can see I do not get the answer 4 and 3.

This approach works perfectly on simple decimals, such as 1.25, 1.5, 1.125... but horribly on repeating decimals, such as 1.33333, 1.2727272727, 1.08333333.

Is there a better way to convert decimals to fractions, or a trick so this process works for repeating decimals?

The formula I am using for the values 4, 3 is =LOG(4*3) or =LOG(B*C). I have tried putting the decimal in. Eg. =LOG(1.3333333*1) but it doesn't return satisfactory results. If anyone knows how to use a decimal instead of a fraction in a logarithmic formula like this it would prevent any need to convert decimal to fraction, and would be the ideal answer. But if that is not possible, then I need to find a way to reduce my decimals to lowest fractions. All help is much appreciated.

See Decimal to Fraction Calculator

1627568745122.png
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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