# COUNTIF & SUMIF (Excel lesson 7 of 45)

> Count or add only the rows that match a condition.

Source: https://spreadsheetpractice.com/learn/countif-sumif · Updated October 29, 2026

- **Course:** [Excel course](https://spreadsheetpractice.com/learn), track "Logic & conditions"
- **Time:** about 8 minutes, 3 graded exercises
- **Functions:** `COUNTIF`, `SUMIF`
- **Access:** free
- **Key formula:** `=COUNTIF(B2:B9,"East")`: Count matching text

## How it works

`COUNTIF(range, criteria)` counts cells in a range that match. `SUMIF(range, criteria, sum_range)` checks one column and adds the matching rows from another.

Criteria can be text (`"East"`), a comparison in quotes (`">1000"`), or a cell reference. To compare against a cell, join the operator on: `">"&G1`.

## Syntax

| Formula | What it does |
|---|---|
| `=COUNTIF(B2:B9,"East")` | Count matching text |
| `=SUMIF(B2:B9,"West",D2:D9)` | Add amounts for West |
| `=COUNTIF(D2:D9,">1000")` | Count with a comparison |
| `=COUNTIF(D2:D9,">"&G1)` | Comparison against a cell |

## Watch out for

- Comparison criteria go in quotes: ">1000", not >1000.
- Text criteria ignore case: "east" matches East.

## The exercises

Solve them in the live grid at [COUNTIF & SUMIF](https://spreadsheetpractice.com/learn/countif-sumif). Each answer is graded, then re-checked on changed data so typed-in numbers don't pass.

1. **Count by region.** In G2, count how many orders came from the East region.
2. **Sum by region.** In G3, total the amounts for the West region.
3. **Count big orders.** In G4, count orders with an amount over $1,000.

Previous: [AND, OR & IFS](https://spreadsheetpractice.com/learn/and-or-ifs) · Next: [COUNTIFS, SUMIFS & AVERAGEIFS](https://spreadsheetpractice.com/learn/countifs-sumifs-averageifs)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
