Overtime looks like a simple subtraction, until an employee is absent. If the time cell is empty, the subtraction returns a negative number and the payroll is wrong. The IF function protects the calculation: it first checks the situation, then calculates only when it makes sense.
The following exercise shows you how to build an overtime calculation step by step, from a simple status to a full AND test inside an IF.
What you will practice in this exercise
You work on the working time of 12 employees. You answer 8 questions, one formula per question:
- Display “Absent” when no time is entered (empty cell)
- Display “Overtime” when the time is above the standard hours (absolute reference $D$1)
- Check that the employee is not absent AND worked more than the standard hours (AND function)
- Calculate the overtime hours (IF + AND + subtraction)
- Fill each formula down the list (copy a formula)
Practice with exercises
IF — Working time and overtime
Spot absences and calculate overtime for 12 employees with a single IF.
Related articles
All the exercises in this series are based on real cases found on Excel forums. Each one answers a question that Excel users really ask.