ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Tests & careers
  3. HR Analytics in Excel: Headcount, Turnover and Tenure

HR Analytics in Excel: Headcount, Turnover and Tenure

By ExcelReady Team·Updated November 2, 2026·7 min read

The short answer

HR analytics in Excel starts with one row per employee, with department, start date, leave date and status. From that table, COUNTIFS gives headcount by department or on any date, hires and leavers in a period, and the turnover rate (leavers divided by average headcount). DATEDIF and YEARFRAC measure tenure, and a summary table feeds the dashboard.

Key takeaways

  • Keep one row per employee with real dates for start and leave, and leave the leave date blank for current staff.
  • COUNTIFS counts headcount by department, status or date range in one formula.
  • A common turnover rate is leavers in the period divided by average headcount. Write down which definition you use.
  • DATEDIF gives whole years of tenure, and YEARFRAC gives a decimal for averages.
  • Use the leave date as the end date for leavers, and a fixed as-of date for everyone else.
On this page+
  1. What is HR analytics in Excel?
  2. Set up the employee data
  3. Headcount with COUNTIFS
  4. Hires, leavers and turnover rate
  5. Tenure with DATEDIF and YEARFRAC
  6. Build a simple HR dashboard
  7. HR analytics questions in Excel tests
  8. Practise it

HR analytics in Excel means turning an employee list into the numbers leaders ask for: how many people work here, how many joined and left, what the turnover rate is and how long people stay. You can answer all of these with COUNTIFS and two date functions on one well-built table. This guide walks through each metric on a small roster, so you can build your own report or prepare for an HR or people-analytics Excel test.

What is HR analytics in Excel?#

HR analytics is measuring the workforce with data, and in Excel it usually means a handful of core metrics built from one employee table:

MetricQuestion it answersMain function
HeadcountHow many people work here now, or on a date?COUNTIFS
HiresHow many joined in the period?COUNTIFS on start dates
LeaversHow many left in the period?COUNTIFS on leave dates
Turnover rateWhat share of the workforce left?Leavers ÷ average headcount
TenureHow long have people stayed?DATEDIF, YEARFRAC
Department mixWhat share works in each team?COUNTIFS ÷ total

These are the same skills that appear in HR job tests. The guide to Excel skills for HR jobs covers the wider role, including payroll totals and eligibility flags.

Set up the employee data#

Every metric is easy when the data is one row per employee, with real dates and no merged cells. Here is a small roster in A1:E9:

ABCDE
1EmployeeDeptStartLeaveStatus
2AishaSales1 Apr 2019Active
3BenSales12 Sep 202231 Mar 2025Left
4CarlaFinance9 Jan 2017Active
5DmitriSales5 Feb 2024Active
6ElenaIT15 Jun 202018 Jul 2025Left
7FaridIT1 Nov 2021Active
8GraceFinance13 Jan 2025Active
9HiroSales20 Aug 2018Active

A few rules keep the analysis reliable:

  • Dates must be real dates, not text. A real date lines up on the right of the cell by default.
  • Leave the Leave cell blank for current staff. Don't type "n/a" or 0.
  • Spell departments the same way every time. "Sales" and "sales " (with a space) count as different values. A drop-down list prevents this.
  • Use a fixed as-of date in a cell, such as 30 Sep 2025 in H1, so the report doesn't change every day.

Headcount with COUNTIFS#

Headcount is a count of active employees, and COUNTIFS adds as many conditions as you need. Total active staff:

Excel formula
=COUNTIF(E2:E9,"Active")

The result is 6. Active staff in Sales needs two conditions:

Excel formula
=COUNTIFS(B2:B9,"Sales",E2:E9,"Active")

The result is 3 (Aisha, Dmitri and Hiro). Ben is in Sales but has left. Put the department names in a column and point the criteria at them, with the ranges locked, to build a full table: =COUNTIFS($B$2:$B$9,G5,$E$2:$E$9,"Active"). Divide each count by the total for the department mix: Sales is 3 / 6 = 50%.

Headcount on a past date#

A status column only shows today. For headcount on a date in G1, count people who had started by then and either hadn't left or left after it:

Excel formula
=COUNTIFS(C2:C9,"<="&G1,D2:D9,"")+COUNTIFS(C2:C9,"<="&G1,D2:D9,">"&G1)

With G1 set to 1 Jan 2025, the result is 7: five current staff who had started, plus Ben and Elena, who were still there. Grace is left out because she started on 13 Jan. The "" criteria matches blank leave dates. The & joins each operator to the date in G1. The comparison of COUNTIF vs COUNTIFS explains why one function handles one condition and the other handles many.

Hires, leavers and turnover rate#

Hires and leavers are date-range counts. Leavers in 2025:

Excel formula
=COUNTIFS(D2:D9,">="&DATE(2025,1,1),D2:D9,"<="&DATE(2025,12,31))

The result is 2 (Ben and Elena). Swap the leave column for the start column, C2:C9, to count hires in 2025: 1 (Grace).

A common turnover rate is leavers in the period divided by average headcount. Headcount was 7 on 1 Jan 2025 and 6 on 30 Sep 2025, so the average is 6.5:

Excel formula
=2/AVERAGE(7,6)

The result is 0.308, or 30.8% when formatted as a percentage. In a real report, point at the cells that hold the counts instead of typing numbers. Organisations define turnover differently: some use monthly averages, some exclude fixed-term contracts or count only voluntary leavers. Write your definition next to the number so readers can compare like with like.

Tenure with DATEDIF and YEARFRAC#

Tenure is the time from the start date to either the leave date or the as-of date. With the as-of date in H1, whole years for the first employee are:

Excel formula
=DATEDIF(C2,IF(D2="",$H$1,D2),"Y")

The IF picks the leave date when there is one and the as-of date otherwise. Aisha has 6 complete years at 30 Sep 2025, and Ben had 2 when he left. Add DATEDIF(...,"YM") for the extra months. The DATEDIF function guide lists every unit.

For an average, decimal years are more accurate. In a Tenure column F, use =ROUND(YEARFRAC(C2,IF(D2="",$H$1,D2),1),2) and fill down. Then average the active staff only:

Excel formula
=AVERAGEIFS(F2:F9,E2:E9,"Active")

The result is 4.77 years. The days between dates lesson practises DATEDIF and tenure formulas step by step.

Build a simple HR dashboard#

A dashboard is a small summary table that updates when the roster changes, plus one or two charts. Lay it out like this:

  1. Inputs: the as-of date and the period start and end dates in labelled cells.
  2. Headline numbers: headcount, hires, leavers, turnover rate and average tenure, each one formula pointing at the inputs.
  3. By department: department names down a column, with COUNTIFS headcount, leavers and AVERAGEIFS tenure beside them.
  4. Charts: a bar chart of headcount by department, and a line of monthly headcount if you track it over time.

A PivotTable is a fast way to explore the same roster, but formulas keep the layout fixed for a monthly pack. The COUNTIFS function guide is a handy reference while you build it. The same counting skills serve other people-heavy roles too; see Excel for healthcare admin, and for checking HR data for errors, Excel for auditors.

HR analytics questions in Excel tests#

HR and people-analytics Excel tests usually give you a roster and ask for exactly these metrics under time pressure: look up a salary, count by department, total by team, calculate tenure, flag a missing ID. The HR roster interview drill works through that format. For a broader timed test, the data analyst Excel test guide explains what to expect, and the data analyst mock test lets you practise against the clock.

Practise it#

Try the COUNTIFS exercise on this page, then practise COUNTIFS and SUMIFS in a live spreadsheet, where you type each formula and it is checked instantly. Finish with the HR roster interview drill to put headcount, tenure and lookups together.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

How many Active employees are in Sales? In H2, use COUNTIFS with two conditions: Dept (B2:B9) is Sales and Status (E2:E9) is Active.

fx
ABCDEFGHI
1
Employee
Dept
Start
Leave
Status
2
Aisha
Sales
43556
Active
Active in Sales
3
Ben
Sales
44816
45747
Left
4
Carla
Finance
42744
Active
5
Dmitri
Sales
45327
Active
6
Elena
IT
43997
45856
Left
7
Farid
IT
44501
Active
8
Grace
Finance
45670
Active
9
Hiro
Sales
43332
Active
10
11
12

Tip: Two pairs: B2:B9 with "Sales", then E2:E9 with "Active". A row counts only if both are true.

Practise this in a lesson

LessonInterview drill: HR rosterWork through a timed-test style HR roster: look up a salary, count, total and list by department, flag bonuses, calculate tenure and handle a missing ID.LessonCOUNTIFS and SUMIFSCount and sum with several conditions at once, and learn why SUMIFS puts the sum range first.LessonDays between dates: DAYS, DATEDIF and TODAYMeasure the gap between two dates in days, months and years, and calculate tenure as of today.Function guideCOUNTIFSCount rows that meet several conditions with COUNTIFS. Examples for text, number ranges and between-values, plus a live exercise.Function guideDATEDIFCalculate tenure, age and contract length with DATEDIF. Learn every unit (Y, M, D, YM), the hidden-function quirks, and practice live.

Frequently asked questions

How do I calculate turnover rate in Excel?

+

Divide the number of leavers in the period by the average headcount, for example =B5/AVERAGE(B2,B3) where B5 holds the leavers and B2 and B3 the start and end headcount, then format as a percentage. Average headcount is often the start and end headcount added together and divided by 2.

How do I count headcount by department in Excel?

+

Use COUNTIFS with the department and the status, for example =COUNTIFS(B2:B9,"Sales",E2:E9,"Active"). Put department names in cells and fill the formula down for a full table.

How do I calculate employee tenure in Excel?

+

Use =DATEDIF(start_date, end_date, "Y") for complete years. For current staff, use a fixed as-of date as the end date, and for leavers use their leave date.

What HR metrics can I track in Excel?

+

Headcount, new hires, leavers, turnover rate, average tenure, department mix and absence days are all straightforward with COUNTIFS, SUMIFS, AVERAGEIFS and date functions.

Sources

  • COUNTIFS function - Microsoft Support
  • DATEDIF function - Microsoft Support
  • YEARFRAC function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What is HR analytics in Excel?
  2. Set up the employee data
  3. Headcount with COUNTIFS
  4. Hires, leavers and turnover rate
  5. Tenure with DATEDIF and YEARFRAC
  6. Build a simple HR dashboard
  7. HR analytics questions in Excel tests
  8. Practise it

Keep reading

Tests & careers· 5 min read

Excel Skills for HR and Recruiting Jobs

The most useful Excel skills for HR and recruiting are counting headcount with COUNTIFS, totalling payroll with SUMIFS, calculating tenure and time to hire with DATEDIF, TODAY and date subtraction, looking up employee records with XLOOKUP or VLOOKUP, flagging eligibility with IF and AND, and cleaning names and dates so reports stay accurate.

Tests & careers· 6 min read

Excel for Healthcare Administration Jobs

Healthcare administration roles use Excel to count and measure patient activity: COUNTIFS for admissions by ward or status, date subtraction for length of stay, DATEDIF for patient age, AVERAGEIFS for average stay by ward, and simple rates such as readmissions divided by admissions. Careful handling of patient data matters as much as the formulas.

Tests & careers· 6 min read

Data Analyst Excel Test: What They Ask and How to Prep

A data analyst Excel test usually asks you to summarise a raw table under time pressure: count and total with COUNTIFS and SUMIFS, pull values with XLOOKUP or VLOOKUP, build a pivot table, list distinct values with UNIQUE and clean messy text. Prepare by practising each task on real data with a timer, not by memorising definitions.

More on tests & careers

  • 25 Excel Interview Questions (With Answers You Can Practise)
  • Excel Interview Questions for Experienced Candidates
  • Excel Interview Questions for Freshers (With Answers)
  • Excel Mock Test: How to Use One to Prepare
  • Excel Practice Exercises With Answers (Beginner to Advanced)
  • 10 Excel Practice Tasks to Do Before Your Test
All tests & careers articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free