# How to calculate the percentage of projects within budget in Excel

Count the rows where actual is at most budget, then divide by the number of projects: `=SUMPRODUCT(--(C2:C11<=B2:B11))/ROWS(B2:B11)`.

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

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

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| Project | Budget | Actual |  | Within budget |
| P-01 | 50000 | 47800 |  |  |
| P-02 | 120000 | 131500 |  |  |
| P-03 | 30000 | 30000 |  |  |
| P-04 | 75000 | 69900 |  |  |
| P-05 | 18000 | 21400 |  |  |
| P-06 | 64000 | 61250 |  |  |
| P-07 | 90000 | 88900 |  |  |
| P-08 | 42000 | 45300 |  |  |
| P-09 | 25000 | 24100 |  |  |
| P-10 | 150000 | 149999 |  |  |

Formula in F1: `=SUMPRODUCT(--(C2:C11<=B2:B11))/ROWS(B2:B11)`

Result: 70%

## How it works

`C2:C11<=B2:B11` compares each project's actual cost with its own budget and returns TRUE when it is on or under budget. SUMPRODUCT counts the TRUEs (7) and ROWS counts the projects (10): 70% came in within budget. P-03 hit its budget exactly and counts as within.

## Other ways

- `=AVERAGE(--(C2:C11<=B2:B11))`: Excel 2021 and Microsoft 365: the average of 1s and 0s is the share of 1s.

## Common mistakes

- COUNTIF can't compare two columns row by row, which is why the formula uses SUMPRODUCT.
- Projects without an actual yet count as within budget, because a blank is 0. Exclude them with `*(C2:C11<>"")` and divide by `COUNT(C2:C11)`.

## Questions

**How do I allow a 5% buffer?**

Scale the budget: `=SUMPRODUCT(--(C2:C11<=B2:B11*1.05))/ROWS(B2:B11)`.

**How do I get the share of the total budget that was overspent?**

Divide total overruns by total budget: `=SUMPRODUCT((C2:C11>B2:B11)*(C2:C11-B2:B11))/SUM(B2:B11)`.

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-projects-within-budget
