Calculate Monthly Employee Headcount in Excel Using Contract Dates
Question details
Calculate a monthly 1 or 0 headcount indicator for each employee using contract dates, termination dates, and employee-type exclusions.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet has employee records in rows and months in columns, and the formula needs to fill across and down.
- Observed behavior
- Each monthly cell should show 1 when the employee is active during any part of that month and is not in an excluded category; otherwise, it should show 0.
Check that column J contains valid start dates, column G contains actual termination dates where applicable, column K contains contract end dates, and column I contains employee types. Enter a valid first-of-month date in N1 and each subsequent monthly header; leave end-date cells blank for an ongoing contract.
Use a monthly date-overlap formula with employee-type exclusions
Use this formula to return a headcount indicator for each employee and month, including employees who start or leave during the month.
The formula uses the actual termination date in column G when present; otherwise, it uses the contract end date in column K. If both are blank, it uses December 31, 2099 as a placeholder for an ongoing contract.
The comparison with the last day of the month is inclusive, so an employee who starts on that day can be counted.
In cell N1, enter the first day of the month as a real Excel date, such as 1/1/2026. Enter first-of-month dates in the headers to the right.
Select N2 and enter =($J2<=EOMONTH(N$1,0))*(IF($G2<>"",$G2,IF($K2<>"",$K2,DATE(2099,12,31)))>=N$1)*($I2<>"not EHQ HC")*($I2<>"EXTERNAL").
Drag the fill handle from N2 across the monthly columns and down the employee rows. The mixed references keep the relevant employee columns and month-header row fixed.
Review a few start, termination, and excluded-type cases. To total a month, enter a formula such as =SUM(N2:N100) below the employee rows, adjusting the range to fit.

Build the Monthly Headcount Formula in WPS Spreadsheet
Use WPS Spreadsheet to enter the same date-overlap formula, fill it across employee records and monthly columns, and total the resulting headcount indicators.
- 1. Open the workbook: In WPS Spreadsheet, choose Open and select the employee workbook.
- 2. Check the columns and headers: Verify that I, J, G, and K contain the employee type, start date, actual termination date, and contract end date respectively. Enter a first-of-month date in N1 and the monthly headers to its right.
- 3. Add the formula: Select N2 and enter =($J2<=EOMONTH(N$1,0))*(IF($G2<>"",$G2,IF($K2<>"",$K2,DATE(2099,12,31)))>=N$1)*($I2<>"not EHQ HC")*($I2<>"EXTERNAL").
- 4. Fill and total: Drag N2's fill handle across and down, then use a formula such as =SUM(N2:N100) below a monthly column to total its indicators.

Frequently Asked Questions
Does the formula count someone who starts on the last day of the month?
Yes. The start-date condition uses <=EOMONTH(N$1,0), so a start on the last day is included if the other conditions are met.
How are permanent contracts handled?
If both the actual termination date in G and contract end date in K are blank, the formula uses December 31, 2099 as the end date. The employee still needs a valid start date and an eligible employee type.
Which end date is used if both G and K have dates?
The formula uses the actual termination date in G whenever it is present. It uses the contract end date in K only when G is blank.
How do I change the excluded employee types?
Edit the text in the two conditions using column I. For example, replace "EXTERNAL" with the exact category you want to exclude, and add another multiplied condition if you need an additional exclusion.
Why is an employee counted in the month they leave?
The formula counts any overlap with the month, including an end date on the first day. Change the date conditions if your organization counts only employees active on a particular reporting date.




