Calculation Issues

How to Count Active Employees Between Start and Termination Dates

Algirdas JasaitisAlgirdas Jasaitis Nov 11, 2026 869 views

Question details

The user needs to calculate the number of active employees for a given statistical month based on their start and termination dates, taking into account currently active employees who do not have a termination date.

How to Count Active Employees Between Start and Termination Dates
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Calculating active employee headcount for HR or administrative reporting using specific monthly date ranges.
Observed behavior
Requires an array or logic formula to evaluate if the statistical month falls on or after the start date and before the termination date, while intelligently treating empty termination date cells as still active.
Before you start

Ensure your employee start and termination dates are formatted as proper date values (not plain text), and verify that your target statistical month reference is a valid date (typically the last day of the target month).

Solution 1Recommended

Use SUMPRODUCT and MIN Formula to Count Active Employees

This method uses the SUMPRODUCT function combined with the MIN function to handle both standard date ranges and blank termination dates (active employees) in a single formula.

The SUMPRODUCT function evaluates multiple criteria arrays simultaneously. To handle employees who haven't left the company, the formula substitutes any blank or ongoing termination date with a far-future date (like December 31, 9999). This guarantees that active employees are correctly factored into the monthly headcount.

1
Set up your data ranges

Identify the cell ranges for your employee start dates (e.g., A2:A100) and termination dates (e.g., B2:B100), as well as the cell containing your statistical target date (e.g., E1).

2
Enter the SUMPRODUCT formula

Select an empty cell where you want the total count to appear and input the formula: =SUMPRODUCT((Start_Date<=Stat_Month)*(MIN(DATE(9999,12,31),Termination_Date)>Stat_Month))

3
Replace placeholder variable names

Update 'Start_Date', 'Termination_Date', and 'Stat_Month' with your actual cell references. For example: =SUMPRODUCT((A2:A100<=E1)*(MIN(DATE(9999,12,31),B2:B100)>E1))

4
Press Enter to calculate

Press the Enter key to execute the formula. The cell will now display the total number of active employees for that specific month.

Use SUMPRODUCT and MIN Formula to Count Active Employees
Alternative Array Handling: If the MIN function does not evaluate correctly across arrays in your specific spreadsheet version, you can substitute the MIN section with an IF statement: IF(Termination_Date="", DATE(9999,12,31), Termination_Date). Remember to press Ctrl+Shift+Enter if using legacy array formulas.
Manage HR Data Efficiently

Easily Calculate Employee Headcount in WPS Spreadsheet

WPS Spreadsheet fully supports complex array formulas like SUMPRODUCT and COUNTIFS, making HR calculations, date evaluations, and headcount reporting highly efficient.

  1. 1. Open your HR roster: Launch WPS Spreadsheet and open your employee dataset containing the start and termination dates.
  2. 2. Input the calculation formula: Click on the cell where you want the headcount displayed and paste the provided SUMPRODUCT or COUNTIFS formula.
  3. 3. Save and share: Save your document in .xlsx format to ensure full compatibility with team members using Microsoft Excel.
Seamless compatibility with Microsoft Excel formulas and date formats.Advanced pivot tables and charting tools for HR reporting.Lightweight application that handles large employee datasets smoothly.
QA img-9

Frequently Asked Questions

Why does my SUMPRODUCT formula return a #VALUE! error?

This error typically occurs if your 'Start_Date' and 'Termination_Date' ranges are not exactly the same size. Ensure both ranges cover the exact same number of rows (e.g., A2:A100 and B2:B100).

How exactly should I define 'Stat_Month' in the formula?

'Stat_Month' should refer to a cell containing the specific date you are checking against. For monthly statistics, this is typically the last day of the month you are analyzing, entered as a standard date (e.g., 10/31/2023).

Can I use these formulas if my dates are stored as text?

No, spreadsheet formulas require dates to be stored as actual date serial numbers to perform mathematical comparisons. You can use the 'Text to Columns' feature or the DATEVALUE function to convert text dates into proper date formats before calculating.