Everything Excel does with times follows from a single design decision: a time is stored as a fraction of a 24-hour day. Noon is 0.5. 6:00 PM is 0.75. 8 hours is a third of a day, stored as 0.3333. That is why subtracting two times gives you a small decimal instead of hours, and why multiplying that decimal by 24 turns it into the decimal hours payroll wants. Hold onto that one idea and every formula in this guide is just bookkeeping.
The layout that keeps it simple
Set up five columns: A for the date or day, B for start time, C for finish time, D for unpaid break minutes, and E for hours worked. Type times in a form Excel recognises, such as 9:00 AM or 17:30, and it will store them as times automatically. Breaks go in as plain numbers of minutes - 30, 45, 60 - in their own column, so every day can carry its own break and anyone reading the sheet can see it. Resist the urge to hide the break inside the formula; a sheet nobody can audit is a sheet nobody should trust.
The core formula
For a normal daytime shift, the hours in E2 are:
=(C2-B2)*24 - D2/60
The first part subtracts the start from the finish and multiplies by 24, converting the fraction of a day into decimal hours. The second part converts break minutes into hours and takes them off. A 9:00 AM start, 5:30 PM finish and 30-minute break returns (0.3542 x 24) - 0.5 = 8.5 - 0.5 = 8.00 hours. If you would rather see the result as hours and minutes, leave out the multiplication and format the cell as [h]:mm instead: =(C2-B2) - D2/1440, where 1440 is the number of minutes in a day. Most timesheets are happier in decimals, because decimals can be added, averaged and multiplied by a pay rate without any further conversion.
Overnight shifts: the MOD formula
Plain subtraction fails when the finish is earlier than the start, because Excel cannot display a negative time and shows #### instead. The fix is the MOD function, which wraps the result around the day:
=MOD(C2-B2,1)*24 - D2/60
A 10:00 PM start and 6:00 AM finish now returns 8.00 hours before the break, correctly. You can use the MOD version for every row, day shifts included, since MOD changes nothing when the finish is already later than the start. Making it the standard formula for the whole sheet removes a whole class of errors - nobody has to remember which rows are nights.
Totaling the week and splitting overtime
Add the hours column with a plain SUM: =SUM(E2:E8) for a seven-day block. Format is where weekly sheets usually break. If the total cell uses a normal time format, anything over 24 hours rolls over and a 40-hour week proudly displays as 16:00. Format the total as [h]:mm if it shows hours and minutes - the brackets mean elapsed time - or leave it as a plain number if your column is already decimal, which is the cleaner option. For the overtime split, two short formulas do it: regular hours are =MIN(total,40) and overtime hours are =MAX(total-40,0). Multiply each by its rate and add: at $18 an hour with time and a half, a 40.50-hour week is =40*18 + 0.5*27 = $733.50. Our guide on totalling hours worked in a week explains the workweek rules behind that split.
A worked mini-sheet
| Day | Start | Finish | Break (min) | Hours |
|---|---|---|---|---|
| Monday | 9:00 AM | 5:30 PM | 30 | 8.00 |
| Tuesday | 8:47 AM | 4:23 PM | 45 | 6.85 |
| Wednesday | 10:00 PM | 6:00 AM | 30 | 7.50 |
| Thursday | 9:00 AM | 5:30 PM | 30 | 8.00 |
| Friday | 9:15 AM | 6:45 PM | 30 | 9.00 |
| Total | 39.35 |
Note Tuesday's 6.85 - that is 6 hours 51 minutes in decimal form, not 6 hours 85 minutes, the misreading that causes more spreadsheet arguments than any other. And Wednesday shows the MOD formula earning its keep inside an otherwise ordinary week.
Checking your sheet against answers you already know
Before a new timesheet earns your trust, test it with shifts whose answers you can verify in your head. A 9:00 AM to 5:00 PM day with no break must return exactly 8.00. The same day with a 30-minute break must return 7.50. A 10:00 PM to 6:00 AM night must return 8.00 before its break, not an error and not 16.00, which is the answer the plain subtraction gives when it runs the wrong way around the clock. A week of five identical 8-hour days must total 40.00, and one extra hour on Friday must move it to 41.00 - no more, no less. If any of those five tests fails, the sheet has a formula or a format wrong, and it is far better to find that out on test numbers than on a real paycheck.
Two habits keep a good sheet good. First, protect the formula cells once they are tested - in Excel, lock the cells and protect the sheet so a stray keystroke cannot overwrite a formula with a typed number, which is the quietest way timesheets corrupt. Leave only the time and break columns open for editing. Second, start a fresh copy each pay period rather than endlessly extending one file. Old weeks stay frozen as a record, new weeks start from formulas you know are clean, and if a dispute ever reaches back three months, you can open that period's file and see exactly what was calculated at the time.
Try it the fast way
For a one-off day, or to spot-check what your spreadsheet is telling you, the hours calculator does the same subtraction with breaks and overnight shifts handled, no formulas to mistype. Keep the Excel sheet for the recurring week, and use the time calculator on the homepage when you are adding up lengths of time that are not clock times at all.
Frequently asked questions
Why does Excel show #### in my hours cell?
A row of hash symbols means Excel is trying to display a negative time, which usually means the start time is later than the end time - common when a shift crosses midnight or a time was typed as AM instead of PM. Use the MOD formula, =MOD(B2-A2,1), for overnight shifts, and check that your times include the right AM or PM. It can also simply mean the column is too narrow, so widen it first.
Why is my weekly total wrong once it passes 24 hours?
Because the cell is formatted as an ordinary clock time, which rolls over at 24 hours. A total of 31 hours displays as 7:00. Change the format of the total cell to [h]:mm - the square brackets tell Excel to show total elapsed hours, so 31:00 displays correctly. This is the single most common Excel timesheet bug.
How do I round times to the nearest 15 minutes in Excel?
Use the MROUND function on the time value: =MROUND(B2-A2,"0:15") rounds the shift length to the nearest quarter hour. To round the punches themselves, apply MROUND to the start and end cells separately before subtracting. MROUND is built into modern Excel; in older versions it may need the Analysis ToolPak add-in.
How do I subtract a lunch break in Excel?
Put the break length in its own column as a number of minutes, then subtract it in the formula. For decimal hours: =(B2-A2)*24 - C2/60, where C2 is break minutes. Keeping the break visible in its own column, rather than buried inside the formula, makes the sheet easy to check and lets different days have different breaks.
Can Excel handle overnight shifts?
Yes, with the MOD function. =MOD(B2-A2,1) returns the correct elapsed time even when the end time is earlier than the start time, because MOD wraps the negative result around the day. Multiply by 24 for decimal hours: =MOD(B2-A2,1)*24. A 10:00 PM to 6:00 AM shift correctly returns 8.
