What you will learn
- Use a cell inside COUNTIF criteria
- Join a comparison sign to a cell with &
How it works
To compare with a cell, join the sign and the cell with &: ">="&E1.
If you just want "equal to the cell", use the cell by itself: =COUNTIF(A2:A9,E6).
Formulas at a glance
=COUNTIF(A2:A9,">="&E1) | at or above E1 |
=COUNTIF(A2:A9,E6) | equal to E6 |
Example
Write the formula to count scores at or above the pass mark in E1.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Score | Pass mark | 70 | ||
| 2 | 85 | ||||
| 3 | 62 | Passed | |||
| 4 | 91 | Not passed | |||
| 5 | 70 | ||||
| 6 | 55 | Score to find | 85 | ||
| 7 | 85 | Equal to E6 | |||
| 8 | 78 | Higher than E6 |
Click E3 and type =COUNTIF(A2:A9,">="&E1), then press Enter.
The answer is 5.
When to use it
- A count that changes when you type a new target
- Counting scores at or above a pass mark in a cell
- Building a small report people can change
Common mistakes
- Writing ">=E1" in quotesThat looks for the text E1. Use ">="&E1.
- Adding a sign when you mean equalFor "equal to", just use the cell: =COUNTIF(A2:A9,E6).
- Not locking the range when copyingLock the range with $ if you copy the formula down.
Practice it on a real sheet
Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.