Excel Time Worked Calculator
Use this calculator to quickly sum up time worked across multiple shifts, similar to how you would calculate time differences in Excel. Enter start and end times in HH:MM format (e.g., 09:00 for 9 AM, 17:30 for 5:30 PM). The calculator automatically handles overnight shifts.
Total Time Worked:
Understanding Time Calculations in Excel
Calculating time worked is a common task, especially for payroll, project tracking, or personal time management. While this calculator provides a quick solution, understanding how Excel handles time can be very beneficial.
How Excel Stores Time
Excel stores time as a fraction of a 24-hour day. For example, 6:00 AM is stored as 0.25 (1/4 of a day), 12:00 PM as 0.5 (1/2 of a day), and 6:00 PM as 0.75 (3/4 of a day). A full day is represented by 1. This internal representation is crucial for performing calculations.
Basic Time Difference Formula
To calculate the difference between an end time (e.g., in cell B2) and a start time (e.g., in cell A2) on the same day, you simply subtract:
=B2-A2
If the result appears as a decimal, you need to format the cell to a time format (e.g., [h]:mm or h:mm).
Handling Overnight Shifts
A common challenge arises when a shift crosses midnight (e.g., starting at 10:00 PM and ending at 6:00 AM the next day). If you use the simple subtraction =B2-A2, Excel will return a negative value or a series of hash marks (#######) because the end time is numerically smaller than the start time. To correctly calculate overnight shifts, you need to add 1 (representing one full day) to the end time if it's earlier than the start time:
=(B2<A2)+B2-A2
The (B2<A2) part evaluates to TRUE (which Excel treats as 1) if B2 is less than A2, and FALSE (which Excel treats as 0) otherwise. This effectively adds 24 hours to the end time if it's on the next day.
Summing Total Time
Once you have the duration for each shift, you can sum them up using the SUM function. However, if your total time exceeds 24 hours, Excel's default time format (h:mm) will reset after 24 hours (e.g., 25 hours will display as 1:00). To display total hours beyond 24, you must use a custom number format:
[h]:mm
The square brackets around h tell Excel to display the total number of hours, even if it's greater than 23.
Example Calculation
Let's say you have the following shifts:
- Shift 1: Start 09:00, End 17:00
- Shift 2: Start 22:00, End 06:00 (next day)
Using the formula =(B2<A2)+B2-A2:
- Shift 1: 17:00 – 09:00 = 8:00 hours
- Shift 2: (TRUE)+06:00 – 22:00 = 1 day + 06:00 – 22:00 = 30:00 – 22:00 = 8:00 hours
Total time worked: 8:00 + 8:00 = 16:00 hours. This calculator performs these exact steps for you.