Count how many employees were active in a given month from their hire and termination dates — an employee counts if they were hired on or before the month end and not yet terminated. SUMPRODUCT does it without a helper column.
The example
Active as of June 30.
| A | B | |
|---|---|---|
| 1 | Employee | Active? |
| 2 | Hired 1/4, no term | yes |
| 3 | Term 5/2 | no |
The formula
The formula:
How it works
How it works:
hire <= month_endmarks everyone hired on or before the month-end date.(term="") + (term>month_end)marks anyone still employed or terminated after the month end.- Multiplying the two TRUE/FALSE arrays keeps only employees who satisfy both conditions.
SUMPRODUCTadds the 1s — the active headcount for that month.
Build a monthly trend by putting month-end dates across a row (use EOMONTH) and copying the formula with the month-end reference relative. You get a headcount-by-month series ready to chart — great for turnover and growth dashboards.
Try it: interactive demo
Month-end date to count active staff (sample of 5).
Variations
Hires in a month
New starts:
Terminations in a month
Leavers:
Active right now
Current count:
Pitfalls & errors
Blank terminations. Active employees have an empty term cell — the (term="") test handles them.
Real dates. Hire/term must be date serials, not text, for the comparisons to work.
Boundary rule. Decide whether someone terminated on the month-end counts — adjust <= vs < accordingly.
Practice workbook
Frequently asked questions
How do I count active employees by month in Excel?
How do I build a headcount trend across months?
How do I count current active staff?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class