I have an Excel spreadsheet of data like:
ColumnA ColumnB
33 11
25 5
6 4
What i would like to do is add a third column which shows the ratio of columnA to columnB in the format of A:B. For example:
ColumnA ColumnB Ratio
33 11 3:1
25 5 5:1
6 4 3:2
Does anyone know of a way to achieve this?
Thanks in advance.
Method 1: How to Calculate the Ratio in Excel. Calculate Ratio Formula: To calculate the Ratio in excel, the Shop 1 will be divided by GCD and the Shop 2 will be divided by GCD. You can place a colon between those two numbers. Example: To see the ratio, enter this formula in cell E2 = B2/GCD(B2,C2)&”:”&C2/GCD(B2,C2).
Try this formula:
=SUBSTITUTE(TEXT(A1/B1,"?/?"),"/",":")
Result:
A B C
33 11 3:1
25 5 5:1
6 4 3:2
Explanation:
This doesn't require any special toolkits or macros. The only downside might be that the result is considered text--not a number--so you can easily use it for further calculations.
Note: as @Robin Day suggested, increase the number of question marks (?) as desired to reduce rounding (thanks Robin!).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With