Many employers and employees need a quick way to calculate the net working time for a day, shift, or week. The most common scenario is a standard workday that includes a lunch break that must be subtracted from the total time ontheclock. This page explains the logic behind the calculation and provides several readytouse formulas that work with different time formats.
08:30).17:00).00:45 for 45 minutes).Excel stores dates and times as serial numbers. One whole day equals 1, so one hour equals 1/24 and one minute equals 1/1440. To make calculations easy, always enter times in hh:mm format (or hh:mm:ss if seconds matter) and format the cells as Time.
If a shift starts and ends on the same calendar day, the calculation is straightforward:
= (End_Time - Start_Time) - Lunch_Duration
Assuming:
A2B2C2= (B2 - A2) - C2
Format the result cell as Custom**: [h]:mm to show total hours even when the total exceeds 24.
When a shift spans midnight (e.g., 22:0006:00), the direct subtraction yields a negative value. Fix it by adding 1 day to the end time:
= (B2 + IF(B2<A2,1,0) - A2) - C2
The IF adds 1 (one whole day) only when the end time is earlier than the start time.
If the lunch break is always the same (for example, 30 minutes), you can embed the value directly in the formula:
= (B2 - A2) - TIME(0,30,0)
Or, using a decimal representation:
= (B2 - A2) - (30/1440) // 30 minutes 1440 minutes in a day
When employees have more than one unpaid break, sum the durations first. Suppose:
| Cell | Description |
|---|---|
| A2 | Start Time |
| B2 | End Time |
| C2 | Lunch (hh:mm) |
| D2 | Afternoon Break (hh:mm) |
= (B2 - A2) - (C2 + D2)
If you prefer a decimal number of hours (e.g., 7.75h), wrap the formula with TEXT or multiply by 24:
= ((B2 - A2) - C2) * 24
Format the cell as Number with two decimal places.
| Employee | Start | End | Lunch | Net Hours |
|---|---|---|---|---|
| Alice | 08:00 | 17:00 | 01:00 | |
| Bob | 22:30 | 06:30 | 00:30 |
Formulas used:
= (B2-A2) - C2= (B3 + IF(B3<A3,1,0) - A3) - C3Both results are formatted with custom [h]:mm to display 8:00 for Alice and 7:30 for Bob.
MAX to force zero: =MAX(0,(B2-A2)-C2).MOD to strip the date: =MOD((B2-A2)-C2,1).30/1440 becomes 30/1440 but ensure system settings match).Assuming a timesheet layout where columns AC are Date, Start, End, and column D holds the lunch duration, place the following formula in column E (Net Hours) and copy it down:
= (C2 - B2) - D2
If overnight work is possible, replace it with the more robust version:
= (C2 + IF(C2<B2,1,0) - B2) - D2
After copying, format columnE as [h]:mm. At the bottom of the column, you can sum the net hours:
= SUM(E2:E100)
Again, format the sum cell with [h]:mm to display total hours correctly.
Calculating hours worked minus lunch in Excel hinges on three simple steps:
(EndStart)Lunch for sameday shifts or add IF(End<Start,1,0) for overnight shifts.[h]:mm (or multiply by 24 for decimal hours).With these formulas you can build accurate timesheets, payroll reports, or any custom dashboard that needs to reflect net working time.
