Quadratic Roots from Decimal to Fraction

andreascostas

Board Regular
Joined
Jan 11, 2011
Messages
150
I found UDF that gives the roots to ax^2+bx+c=0 using the quadratic formula.
The roots are given in decimals. Is there an easy way to change the decimals to improper fractions?
Example: for 15x^2+52x+45=0 the unction returns the roots as -1.8 and -1.667 each in separate cells.
What I need is a way to change -1.8 to -9/5 and -1.667 to 5/3
Can that be done? And how do I format the cells?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
You should be able to accomplish this with number formats.

Highlight the range of cells you want this to affect, then right click on them and go to Format Cells>Number (Tab)>Custom and enter ?/? into the Type field.

Hope this helps!
 
Last edited:
Upvote 0
@andreascostas, given the nature of quadratic equations, you probably want to use MrKowz' method above, but use ??/?? as the Custom format.
 
Upvote 0

Forum statistics

Threads
1,225,754
Messages
6,186,826
Members
453,377
Latest member
JoyousOne

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