27.12 HR: Headcount, Attrition and Salary
Example first. Tara Joshi handles HR reports for a fictional delivery company and wants headcount, attrition and pay on one page.
HR project — in 30 seconds
What: A HR tracker: one Table tblStaff, the calculated column AnnualCTC, KPI cells, a PivotTable by City, a chart and a one-page dashboard.
Why: This is the shape of a real HR report: Active Headcount, Attrition %, Average Salary (Active) are the numbers a manager reads first.
Tiny example: From 6 rows: Active Headcount = 4, Attrition % = 33.3%, Average Salary (Active) = ₹33,250.
HR project — 30 सेकंदात
काय: HR चा tracker: tblStaff नावाची एक Table, AnnualCTC हा calculated column, KPI cells, City प्रमाणे PivotTable, एक chart आणि एका पानाचा dashboard.
का: खऱ्या HR report चा हाच आकार असतो: Active Headcount, Attrition %, Average Salary (Active) हे आकडे manager सगळ्यात आधी वाचतो.
छोटं उदाहरण: 6 rows मधून Active Headcount = 4, Attrition % = 33.3%, Average Salary (Active) = ₹33,250.
HR project — 30 सेकंड में
क्या: HR का tracker: tblStaff नाम की एक Table, AnnualCTC calculated column, KPI cells, City के हिसाब से PivotTable, एक chart और एक पन्ने का dashboard.
क्यों: असली HR report का यही आकार होता है: Active Headcount, Attrition %, Average Salary (Active) वे आँकड़े हैं जो manager सबसे पहले पढ़ता है.
छोटा उदाहरण: 6 rows से Active Headcount = 4, Attrition % = 33.3%, Average Salary (Active) = ₹33,250.
First look at the data (before → after):
Expected result — Calculated column
| EmpID | AnnualCTC |
|---|---|
| E-301 | ₹3,36,000 |
| E-302 | ₹3,84,000 |
| E-303 | ₹3,12,000 |
| E-304 | ₹4,92,000 |
| E-305 | ₹3,60,000 |
| E-306 | ₹4,56,000 |
About this data: Teaching sample for a fictional shop “HomeNest Supplies”. Figures and names (e.g. Vikram Rao) are made up for this lesson on hr headcount attrition and salary.
Expected result — KPI cells (expected results)
| KPI | Formula | Result |
|---|---|---|
| Active Headcount | =COUNTIF(tblStaff[Status],"Active") | 4 |
| Attrition % | =COUNTIF(tblStaff[Status],"Left")/ROWS(tblStaff[Status]) | 33.3% |
| Average Salary (Active) | =AVERAGEIFS(tblStaff[Salary],tblStaff[Status],"Active") | ₹33,250 |
About this data: Demo table only — not real customer or company data. Built to practise hr headcount attrition and salary.
Before table and formula as text
Before — Table tblStaff (fictional sample rows)
| EmpID | City | Dept | Salary | Status |
|---|---|---|---|---|
| E-301 | Pune | Operations | 28,000 | Active |
| E-302 | Pune | Sales | 32,000 | Left |
| E-303 | Nashik | Operations | 26,000 | Active |
| E-304 | Nagpur | Finance | 41,000 | Active |
| E-305 | Kolhapur | Sales | 30,000 | Left |
| E-306 | Nashik | Finance | 38,000 | Active |
About this data: Made-up rows so you can copy the pattern for hr headcount attrition and salary. Currencies may use ₹, £, € or $.
Formula / click path
AnnualCTC: =[@Salary]*12
Active Headcount: =COUNTIF(tblStaff[Status],"Active")
Attrition %: =COUNTIF(tblStaff[Status],"Left")/ROWS(tblStaff[Status])
Average Salary (Active): =AVERAGEIFS(tblStaff[Salary],tblStaff[Status],"Active")
Do it step by step:
- Type the data and press Ctrl+T; name the Table
tblStaffin Table Design › Properties › Table Name. - Add the column AnnualCTC with
=[@Salary]*12; the Table fills it down. - On a KPI sheet type
=COUNTIF(tblStaff[Status],"Active")and the other KPI formulas from the table below. - Click Insert › PivotTable › From Table/Range, put City in Rows and AnnualCTC in Values (Sum).
- Click PivotTable Analyze › PivotChart › Clustered Column, then PivotTable Analyze › Insert Slicer › Dept.
- Move the KPI cells, the chart and the slicer onto a sheet named Dashboard.
स्टेप बाय स्टेप करून बघा:
- Data type करा आणि Ctrl+T दाबा; Table Design › Properties › Table Name मध्ये Table ला
tblStaffनाव द्या. - AnnualCTC column
=[@Salary]*12ने जोडा; Table तो खाली भरते. - KPI sheet वर
=COUNTIF(tblStaff[Status],"Active")आणि खालच्या table मधले बाकीचे KPI formulas type करा. - Insert › PivotTable › From Table/Range वर click करा, Rows मध्ये City आणि Values मध्ये AnnualCTC (Sum) ठेवा.
- PivotTable Analyze › PivotChart › Clustered Column वर click करा, मग PivotTable Analyze › Insert Slicer › Dept.
- KPI cells, chart आणि slicer Dashboard नावाच्या sheet वर हलवा.
स्टेप बाय स्टेप करके देखें:
- Data type करें और Ctrl+T दबाएँ; Table Design › Properties › Table Name में Table को
tblStaffनाम दें. - AnnualCTC column
=[@Salary]*12से जोड़ें; Table उसे नीचे भर देती है. - KPI sheet पर
=COUNTIF(tblStaff[Status],"Active")और नीचे की table के बाकी KPI formulas type करें. - Insert › PivotTable › From Table/Range पर click करें, Rows में City और Values में AnnualCTC (Sum) रखें.
- PivotTable Analyze › PivotChart › Clustered Column पर click करें, फिर PivotTable Analyze › Insert Slicer › Dept.
- KPI cells, chart और slicer को Dashboard नाम की sheet पर ले जाएँ.
The brief. Build an HR sheet: annual CTC per employee, active headcount, attrition % for this simple practice (people who left ÷ all people in the list), average salary of active staff, CTC by city, a chart and a Dept slicer. This attrition % is a simple share of the list, not a formal attrition rate: a formal rate counts the people who left during a set period and divides by the average headcount for that same period, so the two numbers can differ.
Calculated column formulas:
| Column | Formula |
|---|---|
| AnnualCTC | =[@Salary]*12 |
About this data: Fictional worksheet used in class. Safe to edit; nothing here is live production data.
KPI cells (check your numbers):
| KPI | Formula | Result |
|---|---|---|
| Active Headcount | =COUNTIF(tblStaff[Status],"Active") | 4 |
| Attrition % | =COUNTIF(tblStaff[Status],"Left")/ROWS(tblStaff[Status]) | 33.3% |
| Average Salary (Active) | =AVERAGEIFS(tblStaff[Salary],tblStaff[Status],"Active") | ₹33,250 |
About this data: Teaching sample for a fictional shop “HomeNest Supplies”. Figures and names (e.g. Vikram Rao) are made up for this lesson on hr headcount attrition and salary.
PivotTable (expected):
| City | Sum of AnnualCTC |
|---|---|
| Kolhapur | ₹3,60,000 |
| Nagpur | ₹4,92,000 |
| Nashik | ₹7,68,000 |
| Pune | ₹7,20,000 |
| Grand Total | ₹23,40,000 |
About this data: Demo table only — not real customer or company data. Built to practise hr headcount attrition and salary.
Chart and dashboard (one under the other):
- Click inside the PivotTable, then PivotTable Analyze › PivotChart › Clustered Column › OK.
- Add a chart title and data labels with Chart Design › Add Chart Element.
- Click PivotTable Analyze › Insert Slicer, tick Dept and click OK.
- Insert a new sheet named Dashboard. In it, link a card cell to each KPI (for example
=KPI!B2) and format it large and bold. - Cut and paste the chart and slicer onto the Dashboard sheet.
- On the View tab, untick Gridlines in the Show group. Select the dashboard area and click Page Layout › Print Area › Set Print Area.
Template and guide: download the practice template HR_Template.xlsx and read the step-by-step template guide. The template's sample rows may differ from the rows above; the method is the same.
Practice task (try it before you open the answer):
- Which city has the highest sum of AnnualCTC?
- Filter the Table on City = Nashik (Data › Filter): what is Active Headcount for Nashik alone?
- Add the Clustered Column PivotChart and the Dept slicer to your Dashboard sheet.
Answer
Nashik (₹7,68,000). For Nashik only (2 rows): Active Headcount = 2. The chart shows 4 bars, one per city.
Ravindra Bagale's Tip
Write the definition of Active Headcount under its KPI card in small text. Two people reading the same dashboard should agree on what the number means.
Ravindra Bagale's Tip – मराठी
Active Headcount ची व्याख्या त्याच्या KPI card खाली छोट्या अक्षरात लिहा. एकच dashboard वाचणाऱ्या दोघांचं त्या आकड्याच्या अर्थावर एकमत हवं.
Ravindra Bagale's Tip – हिंदी
Active Headcount की परिभाषा उसके KPI card के नीचे छोटे अक्षरों में लिखें. एक ही dashboard पढ़ने वाले दो लोगों को उस आँकड़े के मतलब पर सहमत होना चाहिए.
Loading practice tasks...
- Total headcount (Easy): Add up Headcount in C2:C11. (sheet "Data")
- Average salary (Easy): Average of Avg salary (₹) in F2:F11, rounded to 0 decimals. (sheet "Data")
- Pune rows (Easy): How many rows have City "Pune"? (sheet "Data")
- Max leavers (Easy): Largest Leavers in E2:E11. (sheet "Data")
- Total joiners (Easy): Add up Joiners in D2:D11. (sheet "Data")
- Sales headcount (Medium): Total of Headcount where Department is "Sales". (sheet "Data")
- IT leavers (Medium): Total of Leavers where Department is "IT". (sheet "Data")
- Pune joiners (Medium): Total of Joiners where City is "Pune". (sheet "Data")
- Ops Mumbai headcount (Medium): Headcount where Department is "Ops" and City is "Mumbai". (sheet "Data")
- Net change row 2 (Hard): D2 minus E2. (sheet "Data")
- Attrition rate proxy (Hard): Total leavers / total headcount, 3 decimals. (sheet "Data")
- High salary rows (Hard): How many rows have Avg salary (₹) > 50000? (sheet "Data")
- Above avg headcount? (Hard): "Large" if C2 > average headcount else "Small". (sheet "Data")