Function Problems

How to Count Excel Attendance Between Two Dates with SUMPRODUCT

Steve KSteve K Oct 29, 2026 871 views

Question details

The user needs to count specific attendance marks for individuals between a past date and today using data from a separate worksheet, and then determine if they meet a specific attendance threshold.

How to Count Excel Attendance Between Two Dates Using SUMPRODUCT
Product
Excel
Device & OS
not provided
Scenario
Tracking employee or student attendance across different sheets and checking if they meet a minimum attendance requirement within a specific date range.
Observed behavior
The user wants to calculate the dynamic attendance count based on changing event dates and accurately identify whether the person qualifies based on the counted marks.
Before you start

Ensure that all date values in your worksheets are formatted as standard Excel dates rather than text, and that the names in your summary sheet exactly match the names in your attendance data sheet.

Solution 1Recommended

Use SUMPRODUCT, INDEX, and MATCH to Count Attendance

Combine SUMPRODUCT with INDEX and MATCH to look up a person's name across another sheet and count specific attendance marks within a dynamic date range.

This formula dynamically locates the correct row for a person, checks the dates against your specified range (e.g., from a past event date up to today), and counts the specific attendance marker, such as "P" for Present.

1
Identify Data Ranges

Confirm the ranges on your attendance sheet (e.g., Sheet2). Assume dates are in B3:R3, names in A4:A7, and attendance marks in B4:R7.

2
Select the Target Cell

In your summary sheet, click on the cell where you want the attendance count to be displayed.

3
Enter the SUMPRODUCT Formula

Type the formula: =SUMPRODUCT(--(INDEX(Sheet2!$B$4:$R$7,MATCH($C2,Sheet2!$A$4:$A$7,0),)="P")*--(Sheet2!$B$3:$R$3>=$D2)*--(Sheet2!$B$3:$R$3<=TODAY())) where $C2 is the person's name and $D2 is the start date.

4
Calculate the Result

Press Enter to calculate the total attendance marks for that person between the specified dates.

Use SUMPRODUCT, INDEX, and MATCH to Count Attendance
Date Format Warning: If changing the event date does not update the count, verify that the date entered is later than or equal to the first recorded attendance date, and that all header dates are real Excel date values rather than text.
Seamless Spreadsheet Management

Track Attendance Easily with WPS Spreadsheet

You can seamlessly build and calculate complex attendance formulas like SUMPRODUCT and INDEX/MATCH using WPS Spreadsheet. It offers full compatibility with standard Excel functions, making data management highly efficient.

  1. 1. Open your Workbook: Launch WPS Spreadsheet and open your attendance tracking file.
  2. 2. Apply Functions: Use the built-in formula bar to insert SUMPRODUCT, INDEX, and MATCH effortlessly.
  3. 3. Calculate and Format: Input your date parameters and use the drag-to-fill feature to copy formulas across your roster seamlessly.
Fully compatible with Microsoft Excel formulas, functions, and date formats.Advanced SUMPRODUCT, INDEX, and MATCH function support for complex queries.Free to use with a familiar, user-friendly interface.Cross-platform support for Windows, Mac, and mobile devices.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my SUMPRODUCT formula returning an error or zero?

This usually happens if the dates in your header row or your criteria cells are stored as text instead of standard date formats. Check your cell formatting and ensure they are formatted as a Date.

Can I use this formula if the names on the two sheets are in a different order?

Yes, the MATCH function nested inside the formula ensures that it searches for the specific name regardless of the row order on the attendance data sheet.

How do I count multiple attendance marks, like 'P' (Present) and 'L' (Late)?

You can modify the formula to include an OR logic array, or simply add two SUMPRODUCT formulas together within the same cell—one checking for "P" and the other for "L".