# How to count rows where one column is greater than another in Excel

Compare the two columns directly inside SUMPRODUCT: `=SUMPRODUCT(--(C2:C11>B2:B11))`.

**Excel:** `=SUMPRODUCT(--(C2:C11>B2:B11))` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| Department | Budget | Actual |  | Over budget |
| Marketing | 50000 | 54200 |  |  |
| Sales | 80000 | 76500 |  |  |
| IT | 120000 | 131900 |  |  |
| HR | 30000 | 29800 |  |  |
| Finance | 45000 | 45000 |  |  |
| Operations | 95000 | 102300 |  |  |
| Legal | 25000 | 18400 |  |  |
| Facilities | 60000 | 63750 |  |  |
| R&D | 150000 | 148200 |  |  |
| Support | 40000 | 41100 |  |  |

Formula in F1: `=SUMPRODUCT(--(C2:C11>B2:B11))`

Result: 5

## How it works

`C2:C11>B2:B11` compares each department's actual with its own budget, row by row, and returns TRUE where it is higher. SUMPRODUCT counts the TRUEs: five departments overspent.

Finance spent exactly its budget, so it isn't counted.

## Other ways

- `=SUM(--(C2:C11>B2:B11))`: Excel 2021, Microsoft 365 and Google Sheets handle the array in SUM directly.
- `=SUMPRODUCT(--(C2:C11>=B2:B11))`: Counts departments at or over budget. (Also counts Finance, which spent exactly its budget.)

## Common mistakes

- `=COUNTIF(C2:C11,">"&B2:B11)` doesn't compare row by row; it checks the whole column against each budget and gives a misleading result.
- Blank actuals count as 0 and are never over budget, which may hide missing data.

## Questions

**How do I count rows more than 10% over budget?**

Scale the budget: `=SUMPRODUCT(--(C2:C11>B2:B11*1.1))`.

**Does this work with dates, like shipped after due?**

Yes: `=SUMPRODUCT(--(D2:D11>C2:C11))` counts late shipments when C is the due date and D the ship date.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/count-rows-where-one-column-is-greater-than-another
