Function Problems

Count Unique Employees by Date, Area, and Status in Excel

Elise WilliamsElise Williams Dec 2, 2026 868 views

Question details

Count each employee or contractor once for a selected date range, work area, and worker status.

Count Unique Employees by Date, Area, and Contractor Status in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains multiple records per worker, and the user needs a distinct headcount that meets several criteria.
Observed behavior
The desired result is one count per matching worker, even when that worker appears in multiple rows.
Before you start

Identify the columns containing worker IDs or names, dates, areas, and worker statuses. Use consistent worker IDs where possible, and make sure the date column contains actual dates rather than text.

Solution 1Recommended

Use FILTER and UNIQUE to count matching workers

Use this formula in Microsoft 365 or another Excel version that supports dynamic arrays.

The example assumes worker IDs are in A2:A1000, dates in B2:B1000, areas in C2:C1000, and statuses in D2:D1000. It excludes blank IDs and counts each matching ID once.

1
Enter the criteria

Enter the start date in F2, the end date in F3, the work area in F4, and the employee or contractor status in F5. Use date-only values for F2 and F3.

2
Enter the formula

In an empty cell, enter =IFERROR(ROWS(UNIQUE(FILTER(A2:A1000,(A2:A1000<>"")*(B2:B1000>=F2)*(B2:B1000<F3+1)*(C2:C1000=F4)*(D2:D1000=F5)))),0). Adjust the ranges and criteria cells to match your worksheet.

3
Check the result

Change the values in F2:F5 to test another date range, area, or status. The end-date condition includes times throughout the date in F3.

Use FILTER and UNIQUE to count matching workers
Check unexpected zeros: IFERROR returns zero when no rows match, but it can also hide other formula errors. If the result is unexpected, check the ranges, date values, and criteria spelling.
Count workers in WPS Spreadsheet

Count filtered unique workers in WPS Spreadsheet

Filter the source records by date, area, and status, then copy the matching worker IDs and remove duplicates to obtain a distinct headcount.

  1. 1. Open the workbook: Open the Excel workbook in WPS Spreadsheet and identify the worker ID, date, area, and status columns.
  2. 2. Filter the records: Select the header row and choose Data > Filter. Use the column filter menus to select the required date range, work area, and status.
  3. 3. Copy matching IDs: Copy the visible worker IDs, including the header, to a new worksheet. Verify that only the filtered records were copied.
  4. 4. Remove duplicates and count: Select the copied ID column and use Data > Remove Duplicates, confirming that the selection has a header if prompted. In an empty cell, enter =COUNTA(A:A)-1, replacing A with the copied ID column, to count the remaining nonblank IDs.
Count each matching worker only once.Filter records by date, work area, and worker status.Open and edit Microsoft Excel XLSX and XLS files.Use a familiar spreadsheet interface.
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula count a worker who appears on several dates more than once?

No. FILTER selects the matching records, and UNIQUE returns each matching worker ID once before ROWS counts the results.

Why does the formula return zero when I expect matches?

Check that F2 and F3 contain real dates, F4 and F5 match the source values, and all formula ranges cover the same rows. IFERROR can also hide errors unrelated to missing matches.

Can I use names instead of employee IDs?

Yes, but identical names can cause different people to be counted as one, and inconsistent spelling can count one person multiple times. Use a unique worker ID when available.

Why can't I find Distinct Count in my PivotTable?

Create the PivotTable through Insert > PivotTable and select Add this data to the Data Model if available. Distinct Count may not be supported on your Excel version or platform.

Will one worker be counted in more than one area?

Yes. If the worker has matching records in multiple areas, a separate distinct count for each area can include that worker once per area. The sum of area counts may therefore exceed the overall distinct headcount.