# How to calculate the percentage of cells that meet a condition in Excel

Count the cells that meet it and divide by the count of all cells: `=COUNTIF(B2:B13,">="&E1)/COUNT(B2:B13)`.

**Excel:** `=COUNTIF(B2:B13,">="&E1)/COUNT(B2:B13)` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| Student | Score |  | Pass mark | 70 |
| Ava | 82 |  | Pass rate |  |
| Ben | 64 |  |  |  |
| Chloe | 91 |  |  |  |
| Dan | 70 |  |  |  |
| Eve | 55 |  |  |  |
| Finn | 77 |  |  |  |
| Gia | 88 |  |  |  |
| Hugo | 69 |  |  |  |
| Iris | 73 |  |  |  |
| Jack | 95 |  |  |  |
| Kim | 60 |  |  |  |
| Leo | 81 |  |  |  |

Formula in E2: `=COUNTIF(B2:B13,">="&E1)/COUNT(B2:B13)`

Result: 66.7%

## How it works

COUNTIF counts the scores at or above 70: 8. COUNT counts all the scores: 12. Dividing gives the pass rate, 66.7%. Using COUNT for the total means blank or text entries don't count against the class.

## Other ways

- `=SUMPRODUCT(--(B2:B13>=E1))/ROWS(B2:B13)`: Divides by every row, which suits conditions COUNTIF can't express.
- `=AVERAGE(--(B2:B13>=E1))`: Excel 2021 and Microsoft 365: the average of 1s and 0s is the share of 1s.

## Common mistakes

- Dividing by COUNTA includes text like "Absent" in the total, which lowers the rate. Choose the base on purpose.
- The criteria needs the operator in quotes joined to the cell: `">="&E1`.

## Questions

**How do I calculate the percentage with two conditions?**

Use COUNTIFS on top: `=COUNTIFS(B2:B13,">="&E1,C2:C13,"Math")/COUNTIF(C2:C13,"Math")`.

**How do I show the percentage that failed?**

Subtract from 1: `=1-E2`.

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/percentage-of-cells-that-meet-a-condition
