How to Divide One Column by Another in Google Sheets
Divide matching rows and flag zero-unit inputs for review.
Download practice data · CSVStart the exerciseWatch the tutorial
Watch on YouTube · ShortTry it yourself
Import at A1. Put the formula in D2 and leave D3:D6 empty. Expect 100, 120, Check units, 100, 200. Set B4 to 2: D4 becomes 200. Blank denominators may also trigger the zero check; other errors are not handled.
=ARRAYFORMULA(IF(B2:B6=0,"Check units",A2:A6/B2:B6))Detailed steps
- 1. Start with one row
Column A contains fictional revenue and column B contains units. For the first row, one thousand divided by ten equals one hundred. The basic formula is A two divided by B two.
- 2. Keep the output area empty
Click D two. Leave D three through D six empty so the array can expand. The source ranges must have the same number of rows.
- 3. Add the array and zero check
Use ARRAYFORMULA around IF. If units equal zero, show Check units. Otherwise divide A two through A six by B two through B six. The division happens row by row.
- 4. Review the five outputs
The results are one hundred, one hundred twenty, Check units, one hundred, and two hundred. The zero-unit row remains visible for review instead of being silently treated as zero revenue per unit.
- Keep inputs consistent
Keep both inputs numeric, extend both ranges together, and leave the output cells empty. A blank unit count may also trigger the zero check. Would you use this for prices, speed, or productivity?
A zero denominator is a data problem
Revenue divided by units produces a per-unit value for each matching row. Zero units do not imply a zero price, so the formula flags that row for review rather than hiding the problem as zero. ARRAYFORMULA expands a single formula over the bounded input range; leave the output cells below it empty.
When the result looks wrong
A blank denominator can also satisfy the zero test. Decide whether that means missing data in your real sheet. The formula does not validate currency, negative units or nonnumeric text. If #REF! appears, clear cells blocking the expanded result instead of copying the array formula into every row.
A check you can repeat
The five rows produce 100, 120, Check units, 100 and 200. Changing B4 from zero to 2 makes D4 equal 200. The other four outputs should not change because division uses values from the same row.
Preview the input data
| Revenue | Units |
|---|---|
| 1000 | 10 |
| 600 | 5 |
| 400 | 0 |
| 300 | 3 |
| 800 | 4 |
Need help importing, choosing separators or setting the locale? How to use the practice files.