Attendance Percentage Formula: Don't Divide by Calendar Days

Divide attended days by the workdays due so far, minus approved leave. Calendar-day and whole-row COUNTIF versions come out too low or over 100%.

On this page

Divide days attended by the workdays that were due, not by the days on the calendar. The sample below reads 46% when the weekend and the company holiday sit in the denominator, and 78.57% when only the days due do. A P typed on a Sunday can push a row past 100% if the formula counts every P it finds.

Both mistakes are fixed by a row that marks each date 1 if it was a workday on or before your As of date, and by counting codes only where that mark is 1:

=IFERROR((COUNTIFS(B4:M4,1,B3:M3,"P")+COUNTIFS(B4:M4,1,B3:M3,"L")+0.5*COUNTIFS(B4:M4,1,B3:M3,"H"))/(SUM(B4:M4)-COUNTIFS(B4:M4,1,B3:M3,"V")),"")

Row 4 is that marker row, row 3 holds one-letter codes, and V means approved leave, which comes out of the denominator. The rest of the page builds the sheet it reads from and shows what each shortcut returns on it.

The two-week sample

Twelve calendar days, Monday 2 November to Friday 13 November 2026, with the weekend in the middle. Put the dates in B2:M2 as real dates and the codes in B3:M3:

Mon 2Tue 3Wed 4Thu 5Fri 6Sat 7Sun 8Mon 9Tue 10Wed 11Thu 12Fri 13
CodePPVPVPPHP

P is present, L late (still a full day), H a half day, A absent, S sick, V approved vacation. Wednesday 11 is a company holiday, so put 2026-11-11 in Q2 and leave Q3 free for a second one. The As of date, 2026-11-13, goes in Q4. Two of these entries are traps on purpose: the P on Saturday, and Thursday 12, a workday with nothing in it.

A marker row that knows weekends, holidays and the As of date

In B4, then filled right to M4:

=IF(AND(WEEKDAY(B2,2)<6,COUNTIF($Q$2:$Q$3,B2)=0,B2<=$Q$4),1,0)

WEEKDAY(date,2) numbers Monday as 1, so <6 keeps Monday to Friday. The COUNTIF drops anything listed as a holiday, and the last test drops dates after the As of date. The row reads 1,1,1,1,1,0,0,1,1,0,1,1: nine days due so far, and the Saturday P and the Sunday are out. NETWORKDAYS(B2,M2,Q2:Q3) also returns 9, if you’d rather count that way; working days excluding holidays covers it.

Every count below reads row 4, so the numerator and the denominator stop at the same date without any extra criteria.

A holiday typed as text instead of a real date is the quiet failure here. Google Sheets still matched 2026-11-11 and 11/11/2026 stored as text in Q2, so the row didn’t change. The attendance tracker page notes that LibreOffice does not match such a holiday, so type holidays as real dates.

Attended days, days due, and the rate

These sit in Q6:Q13, each with a label in column P:

CellFormulaReturns
Q6=COUNTIFS(B4:M4,1,B3:M3,"P")5
Q7=COUNTIFS(B4:M4,1,B3:M3,"L")0
Q8=COUNTIFS(B4:M4,1,B3:M3,"H")1
Q9=COUNTIFS(B4:M4,1,B3:M3,"V")2
Q10=Q6+Q7+0.5*Q85.5
Q11=SUM(B4:M4)9
Q12=Q11-Q97
Q13=IF(Q12=0,"",Q10/Q12)0.7857

Q6 is 5 even though six cells in row 3 hold a P: COUNTIFS only looks at columns where row 4 is 1, and the Saturday P isn’t one of them. Q13 is 5.5 attended over 7 days due, which is 78.57% once the cell is formatted as a percentage. The IF returns a blank when nothing is due yet. With an As of date of 1 November a plain Q10/Q12 is #DIV/0!, and wrapping it in IFERROR(…,0) would show 0% for someone who hasn’t had a chance to attend.

What the other denominators return on this sample

Each of these keeps the 5.5 attended days unless the row says otherwise:

DenominatorResult
Calendar days, 12 (Q4-B2+1)45.83%
Scheduled days, 9, without taking V out61.11%
Days due, 7, but every P, L and H on the row counted (6.5 attended)92.86%
Days due, 7 (the formula above)78.57%

The third row is the one that goes over 100%. COUNTIF(B3:M3,"P") counts every P on the row, so it returns 6 here, and a P typed on a Sunday or on the holiday adds to it. With a P on Sunday 8 and another on Wednesday 11, the whole-row version gives 8.5 over 7, which is 121.43%. The marker-row version still reads 5 present days and 78.57%, because neither date is a workday. That is why the counts above use COUNTIFS with the marker row as a second condition; COUNTIF vs COUNTIFS vs SUMPRODUCT compares the three.

A code on a day off is a data problem, not a rounding problem. Either it went in the wrong column or the person worked an extra shift, and the percentage shouldn’t guess which. The free attendance tracker template builds a workday row like this one and adds a column that counts codes typed on days off, so someone looks at them.

An As of date that isn’t the last column

The marker row carries the As of date for a reason. A common version of this formula applies the date only to the denominator, COUNTIFS(B4:M4,1,B2:M2,"<="&$Q$4), and counts codes over every column. With As of 10 November that reads the P on 13 November as attended: 5.5 over 5 days due is 110%, where the marker-row formula gives 4.5 over 5, or 90%. With As of 5 November the same shortcut returns 5.5 over 2, which is 275%, and the marker-row version returns 3 over 3.

A blank workday counts against the person

Thursday 12 is a workday with no code. In this setup it counts as an absence until someone enters something, and it counts in the denominator whether or not anyone has filled it in. The cell that tells you how many are still empty is:

=COUNTIFS(B4:M4,1,B3:M3,"")

It returns 1 here. Enter P for 12 November and it returns 0, attended days become 6.5, and the rate goes from 78.57% to 92.86%. The denominator stays at 7, because that day was due either way.

COUNTIFS only treats a cell as empty if nothing is in it. A cell holding a single space is not empty (Not recorded drops to 0), and P with a trailing space is not a P. Lowercase p is fine, because COUNTIFS ignores case. With a P , a p and a space-only cell in the sample, the rate fell to 64.29% with no error. If codes come from pasted data, count with TRIM instead, which returned 5 present days and 1 empty workday on that row:

=SUMPRODUCT(B4:M4*(TRIM(B3:M3)="P"))
=SUMPRODUCT(B4:M4*(TRIM(B3:M3)=""))

A drop-down limited to the six letters stops most of this when people type, and the template has one.

Whether approved leave counts against attendance

Leaving V in the denominator turns approved vacation into absence: 5.5 over 9 days is 61.11%, against 78.57% when the two V days are taken out. Which one is right is a policy question and the sheet can’t answer it. I’d take V out. Someone shouldn’t lose attendance for leave that was approved in advance, and the percentage is more useful when it describes the days they were expected. If your policy says otherwise, change Q12 to =Q11.

Format the cell, don’t multiply by 100

The rate is a decimal, 0.7857142857. Format Q13 as a percentage (0.00% shows 78.57%). Multiplying by 100 as well gives 78.57, which a percentage format then shows as 7857.14%; 0.875 times 100 shows as 8750.00%. Leaving the stored value as a decimal also keeps it usable in conditional formatting, such as shading anyone under 0.9.

Oscar

Spreadsheet nerd who writes about Excel and Google Sheets formulas.

Google Sheets, 5 December 2026, new private unshared spreadsheet. Formulas were entered as user input through the Sheets API and values were read back. On the 2-13 November sample (P P V P V P _ P H _ _ P, holiday 11 November, As of 13 November) the Counts row read 1,1,1,1,1,0,0,1,1,0,1,1; P, L, H and V on counted days were 5, 0, 1 and 2; attended days 5.5, scheduled days 9 (NETWORKDAYS agreed), days due 7, rate 0.7857142857142857. Dividing by calendar days gave 0.4583, dividing by 9 gave 0.6111, and a whole-row COUNTIF of P returned 6. With a P typed on Sunday 8 November and on the holiday, the whole-row version returned 8.5/7 = 1.2143 while the Counts-row version stayed at 0.7857. Filling the empty 12 November with P gave 6.5/7 = 0.9286 and Not recorded 0. With As of 10 November the Counts-row rate was 4.5/5 = 0.9, and a version that counted codes on every date but limited only the denominator to the As of date gave 5.5/5 = 1.1; with As of 5 November the two gave 3/3 and 5.5/2. With As of 1 November the guarded rate was blank and a plain division was #DIV/0!. A `P ` with a trailing space was not counted, a lowercase `p` was, and a cell holding one space was not counted as empty (rate 0.6429); the TRIM versions returned 5 and 1. A holiday stored as the text 2026-11-11 or 11/11/2026 was still matched. Under a 0.00% format the rate showed 78.57%, and the rate multiplied by 100 showed 7857.14%. A LibreOffice Calc 25.2 recalculation of the core cases matched. Excel was not run.

Next in Templates & Trackers How to Count Checked Checkboxes in Google Sheets (by Row, Column & Condition)