ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Math
  3. How to Calculate a Ratio in Excel

How to Calculate a Ratio in Excel

By ExcelReady Team·Updated November 2, 2026·7 min read

The short answer

To calculate a ratio in Excel, divide the first number by the second: =B2/C2 returns 20 when 240 students share 12 teachers. To show it as a ratio, join the result to text: =ROUND(B2/C2,1)&":1" displays 20:1. For a simplified whole-number ratio such as 16:9, divide both numbers by their GCD.

Key takeaways

  • A ratio is one number divided by another: =B2/C2.
  • =ROUND(B2/C2,1)&":1" shows the ratio as text, such as 22.5:1.
  • =B2/GCD(B2,C2)&":"&C2/GCD(B2,C2) simplifies a ratio to whole numbers, such as 45:2 or 16:9.
  • Keep the plain division in its own column if you need to sort or chart the ratios, because the ":1" versions are text.
  • Wrap the division in IFERROR, or test for zero, so a missing value doesn't show #DIV/0!.
On this page+
  1. What is a ratio in Excel?
  2. How to calculate a ratio with simple division
  3. How to show a ratio as 20:1
  4. How to calculate a simplified ratio with GCD
  5. How to round a ratio
  6. How to show a ratio as a percentage
  7. How to compare ratios with a target or a total
  8. How to avoid #DIV/0! in a ratio
  9. Practise it

To calculate a ratio in Excel, you divide one number by the other, then decide how to show it: as a plain number (20), as text in the familiar style (20:1), or as a simplified whole-number ratio (16:9). Excel has no RATIO function, but division, ROUND, the & operator and GCD cover every case. This guide is for anyone comparing two numbers, such as students per teacher, wins to losses or debt to income.

What is a ratio in Excel?#

A ratio compares two numbers by showing how many times one fits into the other. "20 to 1" means there are 20 of the first for every 1 of the second. In Excel, a ratio is just a division, plus some formatting if you want it to look like 20:1.

All the examples below use this table of schools in A1:C6:

ABC
1SchoolStudentsTeachers
2Oak24012
3Elm18015
4Pine31514
5Ash968
6Birch2109

How to calculate a ratio with simple division#

The simplest ratio is the first number divided by the second. In D2, type:

Excel formula
=B2/C2

The result is 20: Oak has 20 students per teacher. Fill the formula down to D6 (Windows: Ctrl+D; Mac: ⌘D) to get 12, 22.5, 12 and 23.333… for the other schools.

This plain number is the most useful form for analysis. You can sort it, chart it, average it and compare it with a target. The order matters: =C2/B2 gives the opposite ratio, 0.05 teachers per student. Put the thing you are counting "per" second. If you're new to typing formulas like this, the first formulas lesson walks through it.

How to show a ratio as 20:1#

To display a ratio in the A:1 style, join the result of the division to the text ":1" with the & operator. Round it first so you don't get long decimals:

Excel formula
=ROUND(B2/C2,1)&":1"
SchoolFormulaResult
Oak=ROUND(B2/C2,1)&":1"20:1
Elm=ROUND(B3/C3,1)&":1"12:1
Pine=ROUND(B4/C4,1)&":1"22.5:1
Birch=ROUND(B6/C6,1)&":1"23.3:1

To put the 1 first, reverse it: ="1:"&ROUND(B2/C2,1) returns 1:20.

The result is text, not a number. It looks right, but you can't sum, average or chart it, and sorting goes by character, not by value, so "9:1" lands after "20:1". Keep the plain division in one column and the display version in another.

How to calculate a simplified ratio with GCD#

To show a ratio as two whole numbers, such as 45:2, divide both numbers by their greatest common divisor (GCD), the largest whole number that divides both evenly:

Excel formula
=B4/GCD(B4,C4)&":"&C4/GCD(B4,C4)

For Pine, GCD(315,14) is 7, so the result is 45:2 (315 ÷ 7 = 45 and 14 ÷ 7 = 2). For Oak it is 20:1, and for Birch 70:3.

This is the method for screen sizes and mixing ratios. A screen of 1920 by 1080 pixels gives GCD 120, so the formula returns 16:9. GCD only works with whole numbers: it drops anything after the decimal point, so 2.5 is treated as 2. Multiply decimals up to whole numbers first (for example, by 10) before you use it.

How to round a ratio#

Use ROUND when the number of decimals matters to the result, and number formatting when it only matters to the look. =ROUND(B6/C6,1) stores 23.3. Formatting =B6/C6 to one decimal also shows 23.3, but Excel keeps 23.333… underneath, which changes later sums.

Excel formula
=ROUND(number, num_digits)

num_digits is how many decimals to keep: 1 gives 23.3, 0 gives 23 and 2 gives 23.33. ROUNDUP and ROUNDDOWN always round in one direction, which helps when a ratio is a limit, such as "no more than 23 students per teacher". The ROUND function guide has more examples.

How to show a ratio as a percentage#

A percentage compares a part with the whole, so divide by the total, not by the other part. A team with 45 wins and 15 losses has a win-to-loss ratio of 3:1, but a win rate of:

Excel formula
=45/(45+15)

That returns 0.75. Apply the Percent format (Home > %, or Ctrl+Shift+% on Windows and ⌃⇧% on a Mac) to show 75%. Mixing these two up is a common mistake: 45/15 = 3 is a ratio, not 300% of anything useful. Percentages, ratios and discounts all come down to the same division; see how to calculate a discount in Excel and how to calculate tax in Excel for related formulas.

How to compare ratios with a target or a total#

Once the ratio is a plain number, you can test it like any other value. To flag schools with more than 20 students per teacher:

Excel formula
=IF(B2/C2>20,"Over","OK")

Filled down, this returns Over for Pine (22.5) and Birch (23.3), and OK for the rest. Oak is exactly 20, so it is not over.

For an overall ratio across all schools, divide the totals. Don't average the separate ratios:

Excel formula
=SUM(B2:B6)/SUM(C2:C6)

This returns 17.9 when rounded (1,041 students ÷ 58 teachers). =AVERAGE(D2:D6) on the five ratios gives 18.0, because it treats a small school the same as a large one. Here the gap is small, but it grows when the groups are very different in size. The sum-divided-by-sum version is the true overall ratio.

How to avoid #DIV/0! in a ratio#

If the second number is zero or the cell is empty, the division returns #DIV/0!. Catch it with IFERROR:

Excel formula
=IFERROR(B2/C2,"")

This shows a blank instead of the error. To be stricter, test for zero yourself, so other errors (such as text in the cell) still show:

Excel formula
=IF(C2=0,"",B2/C2)

Use one of these whenever ratios feed a report or an invoice. Error values in one cell spread to every total that uses it; the invoice with formulas guide shows the same habit for line totals.

Practise it#

Try the exercise on this page: it combines division, ROUND and & in one formula. Then practise ROUND, ROUNDUP and ROUNDDOWN in a live spreadsheet to control decimals properly, and go back to the first formulas lesson if division and cell references still feel new. Each step is checked as soon as you press Enter.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Show Pine school's student-to-teacher ratio as text. In D4, divide B4 by C4, round it to 1 decimal place and join ":1" to the end.

fx
ABCDE
1
School
Students
Teachers
Ratio
2
Oak
240
12
3
Elm
180
15
4
Pine
315
14
5
Ash
96
8
6
Birch
210
9
7
8
9

Tip: Put B4/C4 inside ROUND with 1 decimal, then add &":1" after the closing bracket.

Practise this in a lesson

LessonFreeYour first formulasType values, write formulas that start with =, and see how they recalculate.LessonROUND, ROUNDUP and ROUNDDOWNControl decimals properly, which isn't the same as formatting.Function guideROUNDRound to decimals, whole numbers or the nearest thousand with Excel's ROUND. Learn when formatting isn't enough, then practice live.

Frequently asked questions

What is the formula for a ratio in Excel?

+

Divide one number by the other, such as =B2/C2. To display it in the A:B style, use =ROUND(B2/C2,1)&":1" or simplify both numbers with GCD.

How do I show a ratio like 3:1 in Excel?

+

Join the rounded division to the text ":1" with the ampersand: =ROUND(B2/C2,1)&":1". The result is text, so keep the plain number in another column if you need to sort or chart it.

How do I simplify a ratio in Excel?

+

Divide both numbers by their greatest common divisor: =B2/GCD(B2,C2)&":"&C2/GCD(B2,C2). For 1920 and 1080 this returns 16:9. GCD works only with whole numbers.

How do I turn a ratio into a percentage in Excel?

+

Divide the part by the whole, not by the other part. For 45 wins and 15 losses, =45/(45+15) returns 0.75, which shows as 75% with the Percent format.

Why does my ratio formula show #DIV/0!?

+

The number you divide by is zero or the cell is empty. Use =IFERROR(B2/C2,"") or =IF(C2=0,"",B2/C2) to show a blank instead.

Sources

  • ROUND function - Microsoft Support
  • Calculation operators and precedence in Excel - Microsoft Support
  • IFERROR function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What is a ratio in Excel?
  2. How to calculate a ratio with simple division
  3. How to show a ratio as 20:1
  4. How to calculate a simplified ratio with GCD
  5. How to round a ratio
  6. How to show a ratio as a percentage
  7. How to compare ratios with a target or a total
  8. How to avoid #DIV/0! in a ratio
  9. Practise it

Keep reading

Math· 6 min read

How to Calculate Discounts and Sale Prices in Excel

To calculate a discounted price in Excel, multiply the original price by one minus the discount: =B2*(1-C2), where B2 is the price and C2 is the discount as a percentage, such as 20%. The amount saved is =B2*C2. To find the discount percent from two prices, use =1-SalePrice/OriginalPrice and format it as a percentage.

Math· 7 min read

How to Calculate Tax and Prices With Tax in Excel

To calculate tax in Excel, multiply the price by the tax rate: =B2*$F$1 gives the tax amount. For the price including tax, use =B2*(1+$F$1). To take tax out of a price that already includes it, divide: =B2/(1+$F$1). Wrap each in ROUND(…,2) to get whole cents, and keep the rate in one locked cell.

Projects· 6 min read

Create an Invoice in Excel With Formulas

To create an invoice in Excel with formulas, keep a price list on its own sheet and use VLOOKUP to bring each item's description and price into the invoice from its code. Multiply quantity by price for each line, add the lines with SUM, work out tax with ROUND so it shows exact cents, and add a due date by adding the payment terms to the invoice date.

More on math

  • Compound Interest Formula in Excel, Step by Step
  • How to Calculate Cost per Unit in Excel
  • COUNT, COUNTA and COUNTBLANK: Counting Cells in Excel
  • How to Calculate Cumulative Percentage in Excel
  • Calculate Depreciation in Excel: Straight-Line, DB and DDB
  • FV Function in Excel: Future Value of Savings
All math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free