Mathew K Analytics

Lesson 12 · Excel: Zero to Expert

Excel Capstone Project: HR Analytics Dashboard from Raw Data | Excel 112

Sheet: Data Workbook: excel112capstone.xlsx. Download it from this page to see the finished result, or start a new blank workbook and build it step by step…

⬇ Download workbook (.xlsx)

What you'll learn

Files for this lesson

Open the workbook in Excel (Microsoft 365 or Excel 2021) and follow along with the video.

📝 Step-by-step guide

Excel 112: Capstone Project - HR Analytics Dashboard from Raw Data#

Sheet: Data

Workbook: excel112_capstone.xlsx. Download it from this page to see the finished result, or start a new blank workbook and build it step by step with the video. Each section below lists exactly what to click and type.

Stage 1: inspect the export and plan the questions#

  • In A1 type Wattlebird Logistics staff export
  • Format A1: bold, font size 14
  • Paste: at A3, rows [['Emp ID', 'Name', 'Department', 'Gender', 'DOB', 'Start Date', 'Salary', 'Employment Type', 'Status', 'Exit Date'], ['E1001', 'Jack Shaw', 'Sales', 'Male', '5-Oct-1999', '21-Jan-2021', 109500, 'Full-time', 'Active', ''], ['E1002', 'Olivia Doyle', 'operations', 'Female', '20-Jul-1984', '4-Jun-2016', 92500, 'Full-time', 'Active', ''], ['E1003', 'chloe murphy', 'Operations', 'Female', '14-Jan-1995', '16-Oct-2015', 72000, 'Full-time', 'Active', ''], ['E1004', 'Liam King', 'Finance', 'Male', '27-May-1987', '2-Aug-2011', 114000, '', 'Active', ''], ['E1005', 'Noah Reid', 'Sales', 'Male', '25-Nov-1987', 20200709, 116500, 'Full-time', 'Active', ''], ['E1006', ' Ethan Kaur', 'Customer Service', 'Male', '15-Aug-1985', '18-Jun-2015', 72000, 'Full-time', 'Active', ''], ['E1007', 'Priya Wilson', 'SALES', 'Female', '19-Sep-1990', '15-Jan-2019', 97000, 'Full-time', 'Active', ''], ['E1008', 'Lachlan Taylor', 'Customer Service', 'Male', '8-Dec-1986', '3-Aug-2022', 58000, 'Full-time', 'Left', '15-Nov-2025'], ['E1009', 'Mei Clarke', 'Technology', 'Female', '2-Sep-1985', '6-Oct-2014', 110000, 'Full-time', 'Left', '8-Nov-2025'], ['E1010', 'ARJUN SMITH', ' Customer service', 'Male', '5-Oct-1984', '20-Nov-2014', 63000, 'Part-time', 'Active', ''], ['E1011', 'Tom Cole', 'Operations', 'Male', '27-Feb-1978', '11-Jul-2009', 65500, 'Full-time', 'Active', ''], ['E1012', 'Ben Brown', 'Operations', 'Male', '23-Sep-1969', 20240906, 60000, 'Full-time', 'Active', ''], ['E1013', 'Sophie Ryan', 'Finance', 'Female', '7-Feb-1966', '3-May-2024', 141500, '', 'Active', ''], ['E1014', 'Grace Martin', 'Operations', 'Female', '4-Jun-1972', '24-Sep-2013', 76500, 'Part-time', 'Left', '26-Aug-2025'], ['E1015', 'Aisha Lee', 'Operations', 'Female', '13-Feb-1969', '28-Jan-2010', 59500, 'Part-time', 'Active', ''], ['E1016', 'Daniel Tran', 'Operations ', 'Male', '6-Jul-1992', '4-Oct-2023', 66000, 'Full-time', 'Active', ''], ['E1017', 'Emily Hughes', 'Customer Service', 'Female', '1-Mar-1974', '6-Apr-2017', 69000, 'Part-time', 'Left', '18-Oct-2025'], ['E1018', 'Hannah Hall ', 'Customer Service', 'Female', '10-Oct-1985', '17-Nov-2010', 67500, 'Part-time', 'Active', ''], ['E1019', 'Zara Patel', 'Customer Service', 'Female', '3-Sep-2001', '11-Sep-2024', 70000, 'Full-time', 'Active', ''], ['E1020', 'Oscar Russo', 'Sales', 'Male', '26-Nov-1966', 20220313, 111500, 'Full-time', 'Active', ''], ['E1021', 'Lucy Cooper', 'Sales', 'Female', '20-Mar-1974', '16-Jul-2012', 108000, '', 'Active', ''], ['E1022', 'hamish chen', 'Operations', 'Male', '19-Nov-1966', '15-May-2017', 82500, 'Part-time', 'Active', ''], ['E1023', 'Ngaio Harris', 'Operations', 'Female', '5-Jun-1999', '13-Jan-2024', 68000, 'Full-time', 'Active', ''], ['E1024', 'Ruby Kelly', 'technology', 'Female', '12-May-1973', '5-Dec-2021', 101500, 'Part-time', 'Active', ''], ['E1025', 'Kai Ward', 'Sales', 'Male', '27-Aug-2002', '28-Feb-2024', 114000, 'Full-time', 'Active', ''], ['E1026', 'Isabella Hart', 'Sales', 'Female', '7-Oct-1985', '21-Feb-2019', 120000, 'Full-time', 'Left', '13-Jan-2026'], ['E1027', ' FATIMA LAM', 'Sales', 'Female', '11-Oct-2000', '24-Feb-2021', 87500, 'Full-time', 'Active', ''], ['E1028', 'Jessica Walker', 'Finance', 'Female', '28-Aug-1966', 20200703, 100000, 'Part-time', 'Active', ''], ['E1029', 'Riley Webb', 'Sales ', 'Male', '6-Jan-1978', '24-Oct-2025', 95500, 'Full-time', 'Active', ''], ['E1030', 'Mohammed Wright', 'Operations', 'Male', '24-Dec-1984', '16-Dec-2015', 78000, 'Full-time', 'Active', ''], ['E1031', 'Amelia Nguyen', 'Sales', 'Female', '3-May-1985', '18-Dec-2024', 110500, 'Casual', 'Active', ''], ['E1032', 'Sam Ford', 'Technology', 'Male', '11-May-1962', '28-Sep-2020', 140000, '', 'Active', ''], ['E1033', 'Lucas Young', 'Operations', 'Male', '21-Jul-1975', '16-Sep-2008', 74500, 'Full-time', 'Active', ''], ['E1034', 'Charlotte Morgan', 'Sales', 'Female', '16-Dec-1989', '21-Feb-2022', 107500, 'Full-time', 'Active', ''], ['E1035', 'Leah Singh', 'Technology', 'Female', '28-Jan-1997', '11-Apr-2024', 104000, 'Full-time', 'Active', ''], ['E1036', 'james bennett ', 'Technology', 'Male', '18-Apr-1971', '28-Aug-2020', 139500, 'Full-time', 'Active', ''], ['E1037', 'Wei Ali', 'customer service', 'Male', '26-Jul-1994', 20221025, 65000, 'Full-time', 'Active', ''], ['E1038', 'Hugo Evans', 'Operations', 'Male', '13-Jan-1986', '5-Dec-2022', 63000, 'Full-time', 'Active', ''], ['E1039', 'Max Ross', 'FINANCE', 'Male', '24-Aug-1997', '19-Mar-2023', 133500, 'Full-time', 'Active', ''], ['E1040', 'Leo Fraser', 'Operations', 'Male', '22-Aug-2002', '1-Jun-2023', 96000, '', 'Active', ''], ['E1041', 'ISAAC SHAW', 'Operations', 'Male', '11-Aug-2004', '17-Sep-2024', 74500, 'Part-time', 'Active', ''], ['E1042', 'Felix Doyle', 'Customer Service', 'Male', '2-Jun-1964', '6-Nov-2009', 59500, 'Full-time', 'Active', ''], ['E1043', 'Cooper Murphy', 'Finance', 'Male', '9-Apr-1968', '24-Dec-2018', 98000, 'Casual', 'Active', ''], ['E1044', 'Harrison King', 'Technology ', 'Male', '19-Nov-2002', '13-Jul-2022', 104000, 'Full-time', 'Active', ''], ['E1045', 'Tahlia Reid', 'Operations', 'Female', '13-Sep-1974', 20100910, 83000, 'Full-time', 'Active', ''], ['E1046', 'Ravi Kaur', 'Technology', 'Male', '11-Nov-2003', '25-Dec-2024', 98500, 'Full-time', 'Active', ''], ['E1047', ' joel wilson', 'Finance', 'Male', '5-May-1989', '6-May-2011', 141500, 'Full-time', 'Active', ''], ['E1048', 'Sienna Taylor', 'Sales', 'Female', '15-Feb-1962', '14-Mar-2013', 98000, 'Casual', 'Left', '8-Mar-2026'], ['E1045', 'tahlia reid ', 'operations', 'Female', '13-Sep-1974', 20100910, 83000, 'Full-time', 'Active', ''], ['E1049', 'Nathan Clarke', 'Operations', 'Male', '17-Apr-1975', '28-Jun-2016', 83000, 'Full-time', 'Active', ''], ['E1050', 'Harper Smith', 'Customer Service', 'Female', '12-Jun-1963', '27-Nov-2012', 66000, '', 'Left', '13-Apr-2026'], ['E1051', 'Owen Cole', ' sales', 'Male', '7-Aug-1971', '16-Jun-2011', 70500, 'Full-time', 'Active', ''], ['E1052', 'Ava Brown', 'Technology', 'Female', '13-Jun-1964', '3-Nov-2010', 138500, 'Full-time', 'Active', ''], ['E1053', 'Patrick Ryan', 'Customer Service', 'Male', '7-Jul-1972', 20101014, 54500, 'Full-time', 'Active', ''], ['E1054', 'Jack Martin', 'Finance', 'Male', '16-Sep-1992', '15-Mar-2020', 103500, 'Full-time', 'Active', ''], ['E1055', 'Liam Lee', 'Technology', 'Male', '19-Mar-1969', '11-Aug-2023', 139500, 'Part-time', 'Active', ''], ['E1056', 'Noah Tran', 'Operations', 'Male', '8-Oct-2002', '1-Jan-2026', 80500, 'Full-time', 'Left', '27-Jan-2026'], ['E1057', 'Ethan Hughes', 'Sales', 'Male', '17-Mar-1978', '4-Jul-2019', 113500, 'Full-time', 'Active', ''], ['E1058', 'Mia Hall', 'CUSTOMER SERVICE', 'Female', '19-May-1981', '22-Jul-2024', 59500, 'Full-time', 'Active', ''], ['E1059', 'Ella Patel', 'Customer Service', 'Female', '12-Jul-1970', '15-Jul-2024', 69500, 'Full-time', 'Active', ''], ['E1060', 'Lachlan Russo', 'Operations', 'Male', '3-Jun-1966', '28-Mar-2020', 89500, 'Full-time', 'Active', '']]
  • Format A3:J3: bold, font colour White, Background 1, fill Blue, Accent 1
  • Click A4 and choose View → Freeze Panes

Ten columns. Emp ID, the employee number. Name, Department, Gender, date of birth, Start Date, Salary, Employment Type, Status, which is either Active or Left, and Exit Date for the people who have left. At first glance it looks fine. But let's look closely, column by column, like a detective.

  • Select B4:C13

Look at row five. The department says operations, all in lower case. Row six, chloe murphy, also in lower case. Row nine, Ethan Kaur has spaces in front of his name, which is why it looks slightly indented. And row ten says SALES in capitals. To you and me, operations and Operations are the same department. To Excel, they're different text. So if we counted staff by department right now, the lower case operations would be counted as a separate department with one person in it. That's problem number one: messy text.

  • Click F8

Instead of a date, it shows twenty million, two hundred thousand, seven hundred and nine. Read it as two zero two zero, zero seven, zero nine. It's the ninth of July twenty twenty, written as year, month, day, with no separators. Some HR and payroll systems export dates like this. It looks like a date to a human, but to Excel it's just a very large number. You can't work out tenure from it, and if you formatted it as a date, you'd get a date tens of thousands of years in the future. That's problem number two: dates that aren't really dates. Notice something else. A real date, like the one in F4, sits on the right of the cell and shows as a date. These broken ones are numbers in the General format. That difference is your clue.

  • Click H7

It's empty. A few people have no employment type at all. I asked HR about it, and they told me the old system left this field blank for full-time staff. So every blank here really means Full-time. That's problem number three: blanks that need filling. But be careful. The Exit Date column is also mostly blank, and that's correct. Active staff haven't left, so they shouldn't have an exit date. Not every blank cell is a mistake. Always ask what a blank means before you fill it.

  • Conditional formatting on A4:A64: highlight duplicates
  • Click A52

Two cells light up in red. E1045 appears in row forty eight, and again in row fifty two. The first is Tahlia Reid in Operations. The second is tahlia reid in lower case, with extra spaces, and operations in lower case. It's the same person, exported twice. That's problem number four. And notice: because the text is different, Remove Duplicates wouldn't catch it yet. We have to clean first, then remove duplicates. Order matters.

Planning the questions#

Sheet: Plan

  • In A1 type HR analytics project plan
  • Format A1: bold, font size 14
  • In A3 type Questions from the manager
  • Format A3: bold

Data checks with formulas#

  • Starting in A10, type these rows (one value per cell, moving right):

    | Data check | Result | |---|---| | Rows in export | =COUNTA(Data!A4:A64) | | Blank employment types | =COUNTIFS(Data!A4:A64,"<>",Data!H4:H64,"") |

  • Starting in the next empty row, type these rows (one value per cell, moving right):

    | Dates stored as numbers | =COUNTIF(Data!F4:F64,">100000") | |---|---|

  • Format A10:B10: bold, font colour White, Background 1, fill Blue, Accent 1

  • AutoFit the width of column A:B (double-click its right edge)

Sixty one rows in the export. Six blank employment types. And eight dates stored as numbers. Eight, because the duplicate Tahlia Reid row has one too. So when we're done, we expect sixty rows, zero blanks and zero broken dates. Let's go and clean.

Stage 2: clean the data#

Sheet: Data

Fixing the text with TRIM and PROPER#

  • Starting in L3, type these rows (one value per cell, moving right):

    | Name clean | Dept clean | |---|---|

  • Starting in L4, type these rows (one value per cell, moving right):

    | =PROPER(TRIM(B4)) | =PROPER(TRIM(C4)) | |---|---|

  • Fill L4:M64 down (drag the fill handle, or select it and press Ctrl+D)
  • AutoFit the width of column L:M (double-click its right edge)

Look at the difference. Row five, operations is now Operations. Chloe Murphy has her capitals. Ethan Kaur has lost his leading spaces. And SALES in row ten is now Sales. Customer Service is a good one to check. Row thirteen had a space in front and a small s. Row forty had two spaces between the words. Both now read Customer Service, exactly the same.

Pasting values back#

  • Select L4:M64
  • Press Ctrl+C
  • Click B4
  • Press Ctrl+Alt+V
  • Press V
  • Press Enter
  • Press Esc
  • Clear L3:M64 (Delete key)

Columns B and C now hold clean text, not formulas. Click any of them and the formula bar shows just the name. Our first problem is solved.

Fixing the dates#

  • In L3 type Start fixed
  • In L4 type the formula =IF(F4>100000,DATE(LEFT(F4,4),MID(F4,5,2),RIGHT(F4,2)),F4)
  • Fill L4:L64 down (drag the fill handle, or select it and press Ctrl+D)
  • Format L4:L64: number format d-mmm-yyyy
  • Click L8

Nine July twenty twenty. The broken number has become a real date. LEFT took two zero two zero, MID took zero seven, RIGHT took zero nine, and DATE built the ninth of July twenty twenty from them. Text like two zero two zero works inside DATE, because Excel happily turns text that looks like a number into a number. And the rows that already had real dates, like row four, simply come through unchanged.

  • Select L4:L64
  • Press Ctrl+C
  • Click F4
  • Press Ctrl+Alt+V
  • Press V
  • Press Enter
  • Press Esc
  • Clear L3:L64 (Delete key)
  • Format E4:F64: number format d-mmm-yyyy
  • Format J4:J64: number format d-mmm-yyyy
  • AutoFit the width of column E:J (double-click its right edge)

Every start date is now a real date in one consistent style. Row eight shows nine July twenty twenty, and row fifteen, which was also broken, shows six September twenty twenty four. A quick tip on that format. In Australia, a date like three slash four could mean the third of April or, to an American colleague, March the fourth. Writing the month as a word removes all doubt.

Filling the blanks with Go To Special#

  • Select H4:H64
  • Press F5
  • Press Alt+S
  • Press K
  • Press Enter

Excel has selected only the six empty cells inside our range. You can see them shaded, scattered down the column, with the first one, H7, as the active cell.

  • Type Full-time
  • Click H7

Every blank now says Full-time. H7 for Liam King, and the others in rows sixteen, twenty four, thirty five, forty three and fifty four. One warning about this trick. Go To Special Blanks selects every blank in the range. If I had selected the whole sheet, it would have filled the Exit Date blanks too, and suddenly all our active staff would have an exit date of Full-time. Always select just the column you mean.

Removing the duplicate#

  • Select A3:J64
  • Ribbon: path Data > Remove Duplicates, ok True
  • Dialog ok: wait 2.5

The message said one duplicate value was found and removed, and sixty unique values remain. The second Tahlia Reid row is gone, and the red duplicate highlight has disappeared from E1045. Our staff list now runs from row four to row sixty three. Sixty real people.

  • Click Plan!B11

Rows in export, sixty. Blank employment types, zero. Dates stored as numbers, zero. Exactly what we predicted. This is the professional habit I really want you to take away: measure the problem before you fix it, then measure again afterwards. Now you can tell your manager the data is clean, and prove it.

Stage 3: a table with calculated columns#

Sheet: Data

A fixed as-at date#

  • Starting in K1, type these rows (one value per cell, moving right):

    | As at date | =DATE(2026,6,30) | |---|---|

  • Format L1: number format d-mmm-yyyy, bold, fill Yellow

  • Name L1 as AsAt (Name Box, or Formulas → Define Name)

Now every formula can simply say AsAt, which reads much better than a dollar-signed L1, and works from any sheet in the workbook.

  • Table: range A3:J63, name Staff

Sixty rows, banded, with filter buttons on every heading, and a name: Staff. The sheet is called Data, the table is called Staff. From now on our formulas talk to the table.

The band lookup tables#

Sheet: Bands

  • Starting in A3, type these rows (one value per cell, moving right):

    | From | Band | |---|---| | 0 | 1. Under 25 | | 25 | 2. 25 to 34 |

  • Starting in the next empty row, type these rows (one value per cell, moving right):

    | 35 | 3. 35 to 44 | |---|---| | 45 | 4. 45 to 54 | | 55 | 5. 55 plus |

  • Starting in D3, type these rows (one value per cell, moving right):

    | From | Band | |---|---| | 0 | 1. Under 70k | | 70000 | 2. 70k to 89k |

  • Starting in the next empty row, type these rows (one value per cell, moving right):

    | 90000 | 3. 90k to 109k | |---|---| | 110000 | 4. 110k to 129k | | 130000 | 5. 130k plus |

  • Table: range A3:B8, name AgeBands
  • Table: range D3:E8, name SalaryBands
  • Format D4:D8: number format $#,##0
  • AutoFit the width of column A:E (double-click its right edge)

Two tidy lookup tables. If HR ever changes the bands, they edit this sheet, and every band in the staff table will update. That's the beauty of keeping rules in a table instead of burying them inside formulas.

Tenure, age and bands#

Sheet: Data

  • Starting in K3, type these rows (one value per cell, moving right):

    | Tenure | Age | Age Band | Salary Band | |---|---|---|---|

  • In K4 type the formula =YEARFRAC([@[Start Date]],IF([@Status]="Left",[@[Exit Date]],AsAt))

  • In L4 type the formula =DATEDIF([@DOB],AsAt,"y")

  • In M4 type the formula =XLOOKUP([@Age],AgeBands[From],AgeBands[Band],,-1)
  • In N4 type the formula =XLOOKUP([@Salary],SalaryBands[From],SalaryBands[Band],,-1)
  • Format K4:K63: number format 0.0
  • Format L4:L63: number format 0
  • AutoFit the width of column K:N (double-click its right edge)

Let's check the first row by hand. Jack Shaw started on the twenty first of January twenty twenty one. To the thirtieth of June twenty twenty six is about five and a half years, and the tenure shows five point four. He was born on the fifth of October nineteen ninety nine, so on our as-at date he's twenty six, because his twenty seventh birthday is still to come in October. Twenty six falls in band two, 25 to 34. And his salary of one hundred and nine thousand, five hundred dollars is just under one hundred and ten thousand, so XLOOKUP correctly gives band three, 90k to 109k. Row five, Olivia Doyle, started in June twenty sixteen, so ten point one years, she's forty one, band 35 to 44.

  • Click K11

His status is Left. He started on the third of August twenty twenty two and left on the fifteenth of November twenty twenty five, so his tenure is three point three years. The IF stopped the clock at his exit date, not at our as-at date. A quick word on YEARFRAC. Without a third argument, it uses a thirty day month, three hundred and sixty day year convention, which accountants use. You can add a third argument of one for actual days instead. Either is fine for a staff report, as long as you're consistent.

Who has been here longest?#

  • Sort: range A3:N63, by Tenure, order desc

At the top, Lucas Young from Operations, who started in September two thousand and eight. Seventeen point eight years. Then Tom Cole, seventeen point zero, and Felix Doyle from Customer Service, with more than sixteen and a half years. Three of our four longest serving people are in Operations or Customer Service. Remember that when we look at the age mix later.

  • Click K63

Noah Tran, nought point one years. He started on the first of January and left on the twenty seventh, less than a month later. Very early leavers like this often point to a problem with recruitment or onboarding, and they're worth a conversation with the hiring manager.

  • Sort: range A3:N63, by Emp ID, order asc

Stage 4: analysis with COUNTIFS and AVERAGEIFS#

Sheet: Analysis

  • In A1 type Workforce analysis as at 30 June 2026
  • Format A1: bold, font size 14
  • Starting in A3, type these rows (one value per cell, moving right):

    | Department | Headcount | % of Total | Avg Salary | Avg Tenure | Leavers | Attrition | |---|---|---|---|---|---|---|

  • In B4 type the formula =COUNTIFS(Staff[Department],A4,Staff[Status],"Active")
  • In D4 type the formula =AVERAGEIFS(Staff[Salary],Staff[Department],A4,Staff[Status],"Active")
  • In E4 type the formula =AVERAGEIFS(Staff[Tenure],Staff[Department],A4,Staff[Status],"Active")
  • In F4 type the formula =COUNTIFS(Staff[Department],A4,Staff[Status],"Left")
  • In G4 type the formula =F4/(B4+F4)
  • In B9 type the formula =SUM(B4:B8)
  • In C4 type the formula =B4/B$9
  • Fill B4:G8 down (drag the fill handle, or select it and press Ctrl+D)

  • Starting in C9, type these rows (one value per cell, moving right):

    | =SUM(C4:C8) | =AVERAGEIFS(Staff[Salary],Staff[Status],"Active") | =AVERAGEIFS(Staff[Tenure],Staff[Status],"Active") | =SUM(F4:F8) | =F9/(B9+F9) | |---|---|---|---|---|

  • Format A3:G3: bold, font colour White, Background 1, fill Blue, Accent 1
  • Format A9:G9: bold, double bottom border
  • Format C4:C9: number format 0.0%
  • Format D4:D9: number format $#,##0
  • Format E4:E9: number format 0.0
  • Format G4:G9: number format 0.0%
  • AutoFit the width of column A:G (double-click its right edge)

Question one, answered. Fifty two active staff. Operations is the biggest team with sixteen people, thirty point eight percent of the company. Then Sales with twelve, Customer Service nine, Technology eight, and Finance seven. The status bar confirms it. The sum of B4 to B8 is fifty two. Sixty in the table, minus eight leavers.

  • Select D4:E9

Question two. The average salary across the company is ninety two thousand, eight hundred and twenty seven dollars. Technology pays the most, one hundred and twenty thousand, six hundred and eighty eight on average, then Finance at one hundred and eighteen thousand, eight hundred and fifty seven. Sales is about one hundred and three and a half thousand. Operations is seventy five thousand, four hundred and sixty nine, and Customer Service the lowest at sixty four thousand, five hundred dollars. Question three. Average tenure is seven and a half years, which is healthy. Customer Service and Operations have the longest serving active staff, eight point nine and eight point seven years. Technology has the shortest, five point three, so it's the newest team.

  • Select F4:G9

Question five. Eight people left during the year, an attrition rate of thirteen point three percent. Customer Service stands out. Three leavers out of twelve, an attrition rate of twenty five percent. One in four people in that team left. Sales is fourteen point three percent, Operations and Technology both eleven point one, and Finance didn't lose anyone at all.

  • Conditional formatting on G4:G8: highlight cells greater than 0.2

Only Customer Service lights up in red. That's the one a manager needs to see. And the rule is live: if next year's numbers push another team over twenty percent, it lights up too.

Who are the leavers?#

  • Go to the Data sheet
  • Filter: range A3:N63, field Status, criteria Left

Eight rows remain. Lachlan Taylor, Mei Clarke, Grace Martin, Emily Hughes, Isabella Hart, Sienna Taylor, Harper Smith and Noah Tran. Look down the Gender column. Six of the eight are women, and only two are men. And look at the tenure column. Apart from Noah, these weren't new starters. Several had been here more than ten years. Losing long serving people costs a lot of experience. Six out of eight is a striking pattern, but it's only eight people. It's a question for the report, not a conclusion.

  • Filter: range A3:N63, clear True
  • Go to the Analysis sheet

Gender and age mix#

  • Starting in A11, type these rows (one value per cell, moving right):

    | Gender | Headcount | % of Total | Avg Salary | |---|---|---|---|

  • Starting in B12, type these rows (one value per cell, moving right):

    | =COUNTIFS(Staff[Gender],A12,Staff[Status],"Active") | =B12/$B$9 | =AVERAGEIFS(Staff[Salary],Staff[Gender],A12,Staff[Status],"Active") | |---|---|---|

  • Fill B12:D13 down (drag the fill handle, or select it and press Ctrl+D)

  • Starting in F11, type these rows (one value per cell, moving right):

    | Age Band | Headcount | % of Total | |---|---|---|

  • In F12 type the formula =AgeBands[Band]

  • In G12 type the formula =COUNTIFS(Staff[Age Band],F12#,Staff[Status],"Active")
  • In H12 type the formula =G12#/B9
  • Format A11:D11,F11:H11: bold, font colour White, Background 1, fill Blue, Accent 1
  • Format C12:C13,H12:H16: number format 0.0%
  • Format D12:D13: number format $#,##0
  • AutoFit the width of column A:H (double-click its right edge)

Nineteen women and thirty three men among our active staff. So the workforce is thirty six point five percent female and sixty three point five percent male. That's common in logistics, but it's worth tracking. Average pay is ninety one thousand, four hundred and forty seven dollars for women, and ninety three thousand, six hundred and twenty one for men. That's a gap of about two point three percent. Be careful with this kind of number, though. It compares everyone, not people in the same job. A proper pay equity review compares like with like.

  • Select G12:H16

Six people under twenty five, nine aged twenty five to thirty four, twelve aged thirty five to forty four, eleven aged forty five to fifty four, and fourteen aged fifty five or over. That last one is the biggest group. Twenty six point nine percent of our staff are fifty five or older. That's an important insight. Over the next ten years, a quarter of the workforce could retire, taking a lot of experience with them.

A PivotTable of department by salary band#

  • Pivot: source Staff, sheet Dashboard, rows ['Department'], columns ['Salary Band'], values [['Emp ID', 'count', 'Staff', '0']]

There's our grid. Five departments down the side, and our five salary bands across the top, in the right order thanks to those numbers at the start of each band name. Customer Service has ten people under seventy thousand and two in the next band, and nobody above. Operations is mostly in the two lower bands. Sales sits in the middle, two, six and six. Finance and Technology fill the top bands. Technology has four people earning one hundred and thirty thousand or more, and Finance three. The grand total is sixty, everyone in the table, including leavers. Remember that number. We'll come back to it.

Stage 5: charts#

Sorted chart data with dynamic arrays#

  • In A12 type Chart data

  • Starting in A13, type these rows (one value per cell, moving right):

    | Department | Staff | |---|---|

  • In A14 type the formula =SORT(Analysis!A4:B8,2,1)

  • Starting in D13, type these rows (one value per cell, moving right):

    | Department | Avg Salary | |---|---|

  • In D14 type the formula =SORT(CHOOSECOLS(Analysis!A4:D8,1,4),2,-1)

  • Starting in G13, type these rows (one value per cell, moving right):

    | Gender | Staff | |---|---|

  • In G14 type the formula =Analysis!A12:B13

  • Format E14:E18: number format $#,##0
  • Format A13:B13,D13:E13,G13:H13: bold

Three small spilled tables. Staff, from Finance with seven up to Operations with sixteen. Average salary, from Technology down to Customer Service. And Female nineteen, Male thirty three.

  • Select A13:B18 and insert a bar chart titled “Active staff by department”

Operations at the top with sixteen, then Sales twelve, Customer Service nine, Technology eight and Finance seven at the bottom. Sorted, so the story reads from top to bottom.

  • Select D13:E18 and insert a column chart titled “Average salary by department”
  • Select G13:H15 and insert a doughnut chart titled “Gender mix, active staff”

The column chart steps down from Technology on the left, about one hundred and twenty one thousand, to Customer Service on the right at sixty four and a half thousand. You can see the pay gap between the office teams and the frontline teams instantly. And the doughnut shows the gender split, nineteen and thirty three. Roughly one third female, two thirds male.

Stage 6: the dashboard#

  • In A1 type Wattlebird Logistics HR Dashboard
  • Format A1: bold, font size 20, font colour Blue, Accent 1
  • Starting in I3, type these rows (one value per cell, moving right):

    | Headcount | | Avg Salary | | Avg Tenure (yrs) | | Attrition | | Female staff | |---|---|---|---|---|---|---|---|---|

  • Starting in I4, type these rows (one value per cell, moving right):

    | =Analysis!B9 | | =Analysis!D9 | | =Analysis!E9 | | =Analysis!G9 | | =Analysis!C12 | |---|---|---|---|---|---|---|---|---|

  • Format I3:J3: merge & centre
  • Format K3:L3: merge & centre
  • Format M3:N3: merge & centre
  • Format O3:P3: merge & centre
  • Format Q3:R3: merge & centre
  • Format I4:J4: merge & centre
  • Format K4:L4: merge & centre
  • Format M4:N4: merge & centre
  • Format O4:P4: merge & centre
  • Format Q4:R4: merge & centre
  • Format I3:R3: bold, font colour White, Background 1, fill Blue, Accent 1, align center
  • Format I4:R4: bold, font size 16, fill #DDEBF7, align center
  • Format K4:L4: number format $#,##0
  • Format M4:N4: number format 0.0
  • Format O4:R4: number format 0.0%

Five KPI cards. Fifty two staff. Ninety two thousand, eight hundred and twenty seven dollars average salary. Seven point five years average tenure. Thirteen point three percent attrition. And thirty six point five percent female. A manager can read those five numbers from across the room.

A slicer on the pivot#

  • Python: code import pythoncom pt = ws.PivotTables(1) pt.HasAutoFormat = False sc = wb.SlicerCaches.Add2(pt, 'Status', 'Slicer_Status') c = ws.Range('I6') try: sc.Slicers.Add(ws, pythoncom.ArgNotFound, 'Status_Slicer', 'Status', c.Top, c.Left, 125, 110) except Exception: sc.Slicers.Add(ws, '', 'Status_Slicer', 'Status', c.Top, c.Left, 125, 110)

Our slicer has two buttons, Active and Left. Both are selected, so the pivot still shows all sixty.

  • Python: code sc = wb.SlicerCaches('Slicer_Status') sc.SlicerItems('Left').Selected = True sc.SlicerItems('Active').Selected = False

Now the pivot shows only the eight people who left. Three from Customer Service, all earning under seventy thousand. Two from Operations in the seventy to eighty nine thousand band. Two from Sales, one in the ninety k band and one in the one hundred and ten k band. And one from Technology. Finance has vanished, because nobody left Finance. And the top band has gone too, nobody earning one hundred and thirty thousand or more left this year. So the people leaving tend to be the lower paid frontline staff. That's a real insight, and the slicer found it with one click.

  • Python: code sc = wb.SlicerCaches('Slicer_Status') sc.SlicerItems('Active').Selected = True sc.SlicerItems('Left').Selected = False

Now the pivot shows the fifty two current staff. The grand total matches our headcount card. Customer Service has seven under seventy thousand and two above. Operations six, eight and two. Sales two, five and five. Technology four in the ninety k band and four in the top band. Finance three, one and three. The bottom row shows the company's pay spread. Thirteen people under seventy thousand, twelve in the seventies and eighties, fourteen in the nineties up to one hundred and nine, six in the next band, and seven on one hundred and thirty thousand or more.

Conditional formatting and the final tidy up#

  • Conditional formatting on B5:F9: highlight color_scale
  • On the ribbon choose View > Gridlines
  • Format A13:B13,D13:E13,G13:H13: fill #DDEBF7
  • Click A2

Look at the heat map. The greenest cells are the big groups, like Operations in the seventy to eighty nine k band with eight people, and Customer Service under seventy thousand with seven. The small groups fade towards yellow and red. Without gridlines, the page looks like a designed report instead of a spreadsheet. At the top, the title and five KPI cards. Down the left, the pivot heat map, the chart data and the salary chart. On the right, the slicer, the headcount bar chart and the gender doughnut. And because everything flows from the Staff table, next year we paste in the new export, clean it the same way, change the as-at date, and click Refresh All on the Data tab. The formulas update by themselves, and the refresh updates the pivot. Before sharing it, protect the sheet, as in video ten.

Stage 7: insights for the manager#

Sheet: Report

  • In A1 type Workforce report for the General Manager, as at 30 June 2026
  • Format A1: bold, font size 14, font colour Blue, Accent 1
  • In A3 type Key findings
  • Format A3: bold
  • In A4 type 1. Attrition is 13.3% overall, but 25% in Customer Service (3 of 12 left).
  • In A11 type Recommendations
  • Format A11: bold
  • In A12 type Review Customer Service pay and workload, and run exit interviews.
  • Click A1

Let me double check every number in the report against our work. Thirteen point three percent is eight leavers out of sixty. Twenty five percent is three out of twelve in Customer Service. Sixty four thousand five hundred is the Customer Service average salary on the Analysis sheet. Nobody in the top pay band left, as the slicer showed us. Six of the eight leavers were women, as the filter on the Staff table showed us. Twenty seven percent is fourteen of fifty two, twenty six point nine rounded. And the headline numbers match the KPI cards exactly. Every statement is backed by a number on the page. That's what makes a report trustworthy.

  • Click Data!A1
  • Press Ctrl+Home
  • Click Dashboard!A2
  • Press Ctrl+S

And that's our finished project. Let's step back and look at what we built. A Data sheet with the raw export, cleaned with TRIM, PROPER, a DATE rebuild, Go To Special and Remove Duplicates, then turned into the Staff table with tenure, age and band columns. A Plan sheet with our questions and data checks. A Bands sheet with the lookup rules. An Analysis sheet with COUNTIFS, AVERAGEIFS, dynamic arrays and conditional formatting. A Dashboard with KPI cards, a pivot heat map, a slicer and three charts. And a written Report for the manager. That's a genuine piece of professional work. If you can do this, you can walk into an office, be handed a messy spreadsheet, and turn it into answers. That's what employers are looking for.

Series recap and what to learn next#

Found this useful?

All lessons, notebooks and datasets here are free. If they helped you, a coffee keeps new lessons coming.