Here’s a formula I’m using in Excel, with integers inserted for one case:
=(114+(88*(1-(97+38)/97))+(88+114)*(1+51*21/(87*16)-1))/114
FYI, this describes one ratio of a rather complicated three-section planetary gear system of a bicycle hub. You may read more about it here: http://sheldonbrown.com/elan.html. Other ratios of this hub use the same formula with different integers representing different gear tooth counts.
The formula, with the values shown, reduces to
=5287177/2565456
Factoring 2565456 using division in Excel (divisors in the left column), I get
2565456
2 1282728
2 641364
2 320682
2 160341
3 53447
19 2813
29 97
Factoring 5287177, I get
5287177
7 755311
Sorry if that looks ragged, I can’t figure out how to format it.
There’s no point taking the factoring any further because I tried 19, 29 and 97, they are not factors of 755311 and so there is no common factor with 2565456
The decimal value, to 15 places, as many as Excel calculates (and maybe one more), is
2.060911198632910
To display a fraction, instead of factoring, Excel employs an approximation process which only produces results out to 3 places in the denominator (sometimes four, inconsistently), and which gives incorrect results if the denominator would have to be longer. Excel gives
2 12/197
for the result when the cell contains the decimal value or the calculated fraction, and
2 369/6058
when integer values are calculated in other cells and plugged into the longer formula!
Close, as the saying goes, but no cigar.
Is there a way (possibly using a macro) to get Excel to reduce a formula, and generate an exact fractional result using the least common denominator? Or can someone recommend other software which will correctly perform this rather mundane task?