Excel has no ratio function, so you build one. The most reliable method uses GCD to reduce both numbers by their greatest common divisor: =A2/GCD(A2,B2)&":"&B2/GCD(A2,B2) turns 40 and 24 into 5:3.
This is the one to use for a proper simplified ratio, but GCD only accepts whole numbers — with decimals it returns #NUM!, so multiply both values first (GCD(A2*100,B2*100)) or round them. For a quick “x to 1” comparison, =ROUND(A2/B2,1)&":1" gives 1.7:1, which is often more readable for things like a staff-to-customer ratio.
There’s also a one-formula shortcut: =SUBSTITUTE(TEXT(A2/B2,"#####/#####"),"/",":") uses Excel’s fraction formatting to reduce the ratio for you. Whichever you use, the result is text, so you can’t do further maths on it — keep the raw division in another cell if you need to sort or chart the values.
A ratio is one of the common methods to compare two values with each other. And it can help you to compare variations between those two values.
Even in our daily life, we use the word RATIO to define the comparison between two different things. When it comes to Excel, we don’t have any single function that can calculate a ratio for us.
But you can calculate it using some custom formulas. So today, in this post, I’d like to show you how to calculate ratios in 4 different ways.
Let’s get started, and make sure to download this sample file from here to follow along.
1. Calculate the Ratio by using the Simple Divide Method
We can use this method when the larger value is divisible by the smaller value. In the below example, we have values 10 and 2, where 10 is divisible by 2.

So you can use this method here. Insert the below formula into the cell and hit enter.
=A2/B2&":"&"1"

here’s how this formula works…
In this formula, we have divided 10 by 2, which gives you 5 in return. So now we have 5 instead of 10 by dividing by 2. And on the other side, we have used 1 instead of 2.

- PROs: #1. Simple to apply. #2. Easy to understand.
- CONs: #1. Limited use. #2. Not applicable if the larger value is not divisible by the smaller value.
2. GCD Function to Calculate Ratio in Excel
As I said, there is no single function in Excel to calculate the ratio for you. But the GCD function is close enough. It gives you the greatest common divisor of both values (the largest number that divides both of them), and then by using a little concatenation, you can calculate the ratio.

And to calculate the ratio, insert the below formula into the cell and hit enter.
=A2/GCD(A2,B2)&":"&B2/GCD(A2,B2)

here’s how this formula works…
Maybe it looks complex to you, but it’s simple in reality. Let me explain this in two parts.

As I said, GCD gives you the greatest common divisor of both values. So here you have to use GCD in both parts of the formula to get that common divisor.
After that, you have to divide both of the values by that common divisor. And, in the end, a little concatenation to join both of the values using a colon.
- PROs: #1. It’s a dynamic formula, so it doesn’t matter even if you change the values. #2. Easy to apply.
- CONs: #1. The GCD function only works with integers. If you have decimals in your values, GCD cuts off the decimals, so the ratio won’t be simplified (7.5 and 2.5 give 7.5:2.5).
3. SUBSTITUTE and TEXT for Ratio Calculation
A combination of two awesome functions. Yes, you can use the SUBSTITUTE and TEXT functions to calculate the ratio. This method works like a charm just like the GCD function. Here we have the below values to calculate the ratio.

In a cell, insert the below formula and hit enter.
=SUBSTITUTE(TEXT(A2/B2,"#####/#####"),"/",":")

here’s how this formula works…
This formula also works in two parts: TEXT and SUBSTITUTE.

First, you divide both of the numbers, and then the TEXT function formats the result as a fraction.
Second, by dividing both of the values, you have got 10, and when you convert this value into a fraction, you will get 10/1.
Third, replace the forward slash with a colon. And we have the SUBSTITUTE function for that.
- PROs: #1. It’s a dynamic formula, so it doesn’t matter even if you change the values. #2. Simple to use and understand. #3. It also works with decimals (7.5 and 2.5 give 3:1).
- CONs: If you have simple values to calculate a ratio, it’s not good to use this method. And as the format allows up to five digits on each side, a ratio that can’t be simplified within five digits comes out as the closest fraction.
4. Calculate the Ratio with Round Function
Using the ROUND function to calculate a ratio is also a useful method. This is especially useful when you want to calculate ratios with decimals for accurate comparison.
Here we have values in which the higher value is not divisible by the smaller value. So, in this situation, instead of using them as they are, you can divide them and show the final ratio with decimals.

Just insert the below formula into the cell and hit enter.
=ROUND(A2/B2,1)&":"&1

And, here you have a ratio with decimals.
here’s how this formula works…
You can split this formula into two different parts to understand it. First of all, you divide the larger value by the smaller value and use the ROUND function to get the result with one decimal. Second, you have to use a colon and “1” at the end.
- PROs: #1. Useful when you want to get results with decimals. #2. The final value will be more accurate.
- CONs: #1. Not applicable in all situations.
This formula expects the larger value in A2. If the smaller value can be in either cell, use IF to always put 1 on the smaller side. With 4 and 10, it returns 1:2.5:
=IF(A2>=B2,ROUND(A2/B2,1)&":1","1:"&ROUND(B2/A2,1))
Calculate the Ratio of Three Values
GCD can take more than two values, so the same method works for three values as well. With 6, 9 and 15 in A2:C2, the following formula returns 2:3:5.
=A2/GCD(A2:C2)&":"&B2/GCD(A2:C2)&":"&C2/GCD(A2:C2)
Calculate a Ratio with Decimal Values
As GCD only works with whole numbers, multiply both values by 10 (or 100 for two decimals) before you use it. With 7.5 and 2.5, the following formula returns 3:1.
=A2*10/GCD(A2*10,B2*10)&":"&B2*10/GCD(A2*10,B2*10)
Which Method to Use
- Simple divide: only when the larger value is divisible by the smaller one.
- GCD: the best choice for whole numbers, and for three or more values.
- TEXT and SUBSTITUTE: for two values with decimals, in one short formula.
- ROUND: when you want a “something to 1” ratio, like 2.5:1.
Conclusion
As I said, a ratio is a useful method to compare two values with each other. And now, you have different methods to calculate it in your favorite application, yes, in Excel.
All the methods that we have used above can help you to calculate ratios in different situations with different types of values.
I hope this will help you in your work. Now, tell me one thing. Do you have any other method for calculating the ratio? Please share with me in the comment section. I would love to hear from you.
And please don’t forget to share this tip with your friends. I’m sure they will appreciate it.
Frequently Asked Questions
Why does my ratio formula show #DIV/0!?
One of the values is 0 or the cell is blank, so the formula divides by zero. A ratio with zero has no real meaning, so check the data, or wrap the formula in IFERROR to show a blank instead.
Can Excel show a ratio as a number format?
Not directly. A ratio like 5:2 is text, which is why all the methods above join the two parts with a colon. If you need to calculate with it later, keep the result of the division (like 2.5) in a separate cell.
How do I calculate a ratio as a percentage?
Divide the first value by the total and format the cell as a percentage. For example, with 10 and 4, A2/(A2+B2) shows 71% for the first part.
You have a small bug on the image under #2 GCD Function
The image references A3 and B3, when it should be referencing A2 and B2. The formula in the screenshot is correct.
Overall great techniques! Thank you
Very useful, straightforward and simple information. I wasn’t left more confused. Thank you.
Thank you so much for sharing the ratio calculation.
How do I calculate a ratio when I only have one number?
I have been given Amounts contributed by 4 people and I need to right the contributions as a ratio on excel
None of these suggestions work me…
i want to get the formula for student teacher ratio
there is 370 students in a class
1 teacher is required for 40 students
2 teacher for 90 and
3 teacher for 120 and after it 1 teacher on each 40 students
When i entered formula in Cell C2 I get ” #NAME? ” this massage.
What to do?
“
I liked very much.
Good and useful
Thanks puneet .It’s such a useful platform to learn excel
You’re welcome. 🙂