← 30 Days Excel Series
Day 27 of 30IntermediateDomain Application

Day 27: HR & People Analytics in Excel

5 questions · Excel Interview Preparation

Q1

How do you calculate attrition rate in Excel?

Attrition Rate = (Employees who left / Average headcount) × 100. Average headcount = (Opening headcount + Closing headcount) / 2. Example: =B2/AVERAGE(C2,D2)*100 where B2 = leavers, C2 = opening count, D2 = closing count. Monthly attrition is annualised by multiplying by 12: =B2/AVERAGE(C2,D2)*100*12. Calculate department-wise using SUMIF for leavers and AVERAGEIF for headcount.

💡 Interview tip: Attrition calculation is one of the most common HR analytics questions. Know both the formula and the difference between "number left" and "average headcount" in the denominator.
Q2

How do you calculate an employee's exact tenure in years and months?

Years: =DATEDIF(JoiningDate, TODAY(), "Y"). Complete months beyond years: =DATEDIF(JoiningDate, TODAY(), "YM"). Combined text: =DATEDIF(A2,TODAY(),"Y")&" years "&DATEDIF(A2,TODAY(),"YM")&" months". For employees who have left, replace TODAY() with their leaving date. Group tenure into bands using IF or IFS: =IFS(years<1,"<1 Year",years<3,"1-3 Years",years<5,"3-5 Years",TRUE,">5 Years").

💡 Interview tip: DATEDIF is the only reliable formula for exact tenure in complete years and months — not YEARFRAC, which returns fractional years.
Q3

How do you calculate the average salary by department using Excel?

Using AVERAGEIF: =AVERAGEIF(DepartmentColumn, "Sales", SalaryColumn). For all departments at once: use a Pivot Table with Department in Rows and Salary in Values (set to Average). For percentile-based salary analysis by department: use AVERAGEIFS with PERCENTILE in a more complex array formula, or analyse each department separately in Power Query using Group By.

💡 Interview tip: AVERAGEIF for one department; Pivot Table for all departments simultaneously. Know which tool to use when.
Q4

How do you build an age-band distribution chart for workforce analysis?

Step 1: calculate each employee's age: =DATEDIF(DOB, TODAY(), "Y"). Step 2: create an age band column using IFS: =IFS(age<25,"<25",age<30,"25-29",age<35,"30-34",age<40,"35-39",age<50,"40-49",TRUE,"50+"). Step 3: use COUNTIF or a Pivot Table to count employees in each band. Step 4: create a column chart sorted by age band. This shows the age distribution of the workforce — important for succession planning and retirement risk analysis.

💡 Interview tip: Age band analysis is standard in HR analytics reports. The IFS formula for banding is reusable for salary bands, experience bands, and performance score bands.
Q5

How do you track and analyse leave data in Excel?

Structure the leave data as a flat table: EmployeeID, EmployeeName, Department, LeaveType (Casual/Sick/Earned), StartDate, EndDate, Days. Calculate days with NETWORKDAYS(StartDate, EndDate) for working days only. Analysis with Pivot Table: rows = Department, columns = LeaveType, values = Sum of Days. Key metrics: average leave days per employee (=Total Days / Headcount), leave pattern by month (group StartDate by month in Pivot Table), employees with more than N sick leave days (COUNTIFS or filter on the flat table).

💡 Interview tip: Always store leave data as a flat transaction table — not a calendar grid. The flat table approach enables all types of analysis; a calendar grid is only useful for display.
← Day 26All DaysDay 28

Want 1:1 Excel coaching?

Join EVIKA Academy for live Excel training, real projects, and placement support in Delhi NCR.

Book Free Demo →
Best Data Analytics Course in Noida Delhi NCR | EVIKA ACADEMY