How to calculate attendance percentage in Excel
Formula (Excel and Google Sheets)
=COUNTIF(B2:G2,"P")/COUNTA(B2:G2)Divide the days present by the days recorded: =COUNTIF(B2:G2,"P")/COUNTA(B2:G2), filled down.
- Result on the example
- one result per row in
H2, filled down toH7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in H2, filled down to H7. Change any input and the result updates, or edit the formula to experiment.
How it works
COUNTIF counts the P marks in the student's row and COUNTA counts the days that have any mark. Finn joined on March 4, so his two blank days are left out of his total: 3 of 4 recorded days is 75%.
Late (L) counts as not present here.
=COUNTIF(B2:G2,"P")/COUNTA(B2:G2)Result1
B2:G21 row × 6 cols: "P", "P", "P", "P", …A range: 6 cells in one row.
COUNTIF(B2:G2,"P")6COUNTIF: Counts cells that meet one condition.- range
B2:G21 row × 6 cols: "P", "P", "P", "P", … - criteria
"P"
- range
COUNTA(B2:G2)6COUNTA: Counts cells that are not empty.- value1
B2:G21 row × 6 cols: "P", "P", "P", "P", …
- value1
COUNTIF(B2:G2,"P")/COUNTA(B2:G2)1The / operator divides.
In Google Sheets
The same formula works in Google Sheets: =COUNTIF(B2:G2,"P")/COUNTA(B2:G2). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =COUNTIF(B2:G2,"P")/COLUMNS(B2:G2) | 100.0%, 66.7%, 66.7%…Different result | Divides by every school day, so blank days count as absences. Lowers Chloe to 66.7% and Finn to 50%. |
| =(COUNTIF(B2:G2,"P")+COUNTIF(B2:G2,"L"))/COUNTA(B2:G2) | 100.0%, 83.3%, 80.0%…Different result | Counts late arrivals as present. Raises Ben and Eve. |
Common mistakes
- Pick the base on purpose: days recorded (COUNTA) or all school days (COLUMNS). Schools usually define it in their policy.
- Codes typed in different ways ("p", "Present") break the count. Use a drop-down list for the marks.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Calculate attendance percentage
H2, calculate the share of recorded days the student was present (P), then fill down to H7.Questions
How do I flag students below 90% attendance?
Use =H2<90%, or conditional formatting with the same rule.
How do I count half days?
Give them their own code, say "H", and add half of them: =(COUNTIF(B2:G2,"P")+COUNTIF(B2:G2,"H")/2)/COUNTA(B2:G2).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.