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.
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.