Excel Formulas for Timesheet Calculations and Overtime

Formulas & functions · Updated December 2, 2026

For a basic Excel timesheet, subtract the start time from the end time and multiply by 24 to get decimal hours: with clock-in in B2 and clock-out in C2, use =(C2-B2)*24. If a shift crosses midnight, use =MOD(C2-B2,1)*24. Format the result as a number, then adapt the calculation for breaks, weekly totals, and overtime according to your organization’s rules.

Set Up the Timesheet Columns

A clear layout makes formulas easier to check. A common daily sheet has columns for employee, date, start time, end time, unpaid break, and hours worked. Enter actual Excel time values in the time columns, not text that merely looks like a time. For example, enter 8:30 AM or 17:00, and format the cells with Home > Number using a Time format.

Excel stores a time as a fraction of a 24-hour day. That is why subtracting two times gives a fraction: 8 hours is one-third of a day. Multiplying by 24 converts that fraction into decimal hours, which are convenient for totals and payroll review. Keep the raw start and end entries in separate cells so the underlying records remain visible.

  • Use one row per shift or workday, and include a date so entries can be grouped by workweek.
  • Enter break duration consistently, such as a duration formatted as [h]:mm, or enter start and end times for the break and calculate its length.
  • Use a separate column for calculated hours rather than overwriting the time entries.

Calculate a Shift, Including Breaks

For a shift that begins and ends on the same date, subtract start from end. With start time in B2 and end time in C2, enter =(C2-B2)*24 in D2. If B2 is 9:00 AM and C2 is 5:30 PM, the result is 8.5 hours. Format D2 as Number, for example with two decimal places; applying a time-of-day format to a decimal-hours result can make it display misleadingly.

To deduct an unpaid break entered as a duration in D2, with start in B2 and end in C2, use =((C2-B2)-D2)*24. For 9:00 AM to 5:30 PM with a 30-minute break entered as 0:30, the result is 8.0 hours. Format the break cell as [h]:mm so durations display clearly, especially if a duration could exceed 24 hours.

If break times are recorded separately, calculate the break duration first. With break start in D2 and break end in E2, use =(E2-D2)*24 to return break hours for a same-day break. Deduct that result from the shift calculation. Whether a break is paid, and which breaks must be recorded, depends on workplace policy and applicable rules; the spreadsheet should reflect the approved method rather than assume a universal standard.

Handle Overnight Shifts and Missing Entries

A simple subtraction produces a negative value if a shift ends after midnight because the end time appears earlier on the clock. With start in B2 and end in C2, =MOD(C2-B2,1)*24 returns the elapsed hours across midnight. A shift from 10:00 PM to 6:00 AM returns 8.0. MOD wraps the time difference into a 24-hour day, so this approach is appropriate when a shift is shorter than 24 hours and the entries represent one start and one end.

Blank cells need attention: some formulas can treat a missing time as zero and show an implausible result. To leave the hours cell blank until both times are entered, use =IF(OR(B2="",C2=""),"",MOD(C2-B2,1)*24). This is useful for an unfinished timesheet, but it does not validate whether an entry is correct. Consider checking for missing dates, impossible durations, or an end time entered in the wrong cell before approving totals.

Sum Daily and Weekly Hours

With daily decimal hours in E2:E8, use =SUM(E2:E8) to total the week. If the entries are 8, 8, 8, 8, and 8 hours, the result is 40. Decimal hours display naturally as a number. If instead you keep worked durations as Excel times, sum those values and format the total as [h]:mm; ordinary h:mm can wrap after 24 hours and show an incorrect-looking total.

For example, if daily durations are in E2:E8, use =SUM(E2:E8) and apply the custom number format [h]:mm. Five daily entries of 8:00 display as 40:00. The same underlying total is 40 hours, not a time of day. To convert a duration total to decimal hours, multiply the sum by 24; do not multiply an already-decimal total by 24 again.

Keep week boundaries explicit. A weekly total should include the dates that belong to the relevant workweek, not simply the next seven filled rows if the sheet may contain gaps, multiple employees, or several weeks. For a larger timesheet, a structured Excel table with clear headers can make formulas easier to fill down and maintain.

Calculate Overtime Carefully

Excel can separate hours above a chosen threshold, but the threshold and the meaning of overtime must come from the applicable policy or rules. As a simple illustration only, assume regular weekly hours are capped at 40 and total hours are in F2. With that layout, regular hours are =MIN(F2,40), and hours above 40 are =MAX(F2-40,0). If F2 is 43.5, the results are 40 regular hours and 3.5 hours above the example threshold.

This example does not determine whether those hours legally qualify for overtime, how daily limits apply, whether multiple workweeks should be combined, or what rate should be paid. Those details vary by jurisdiction, contract, and workplace policy. A spreadsheet formula is a calculation aid, not a substitute for verifying the rules that govern the specific timesheet.

Common Formula and Formatting Problems

  • Times stored as text: Subtraction may fail or return unexpected results. Re-enter the value as a time, or check the cell’s format and source data.
  • Wrong number format: A decimal result such as 8.5 should be displayed as a number. A summed duration should use [h]:mm if it can exceed 24 hours.
  • Break entered in the wrong unit: A break stored as 0.5 means half a day, not half an hour. Enter a duration such as 0:30, then multiply the resulting time difference by 24 when converting to hours.
  • Overnight shift: Ordinary end-minus-start subtraction can be negative. Use MOD for a single overnight interval.
  • Rounding too early: Keep sufficient precision in the calculation and round only where the approved process requires it. Rounding every shift can cause weekly totals to differ from a total calculated from unrounded entries.

To inspect a formula, select its cell and look in the formula bar. Check a few known examples by hand, including a normal shift, a shift with a break, and an overnight shift. Protecting formula cells from accidental edits can also help, but retain a clear way for authorized users to enter and correct the source times.

Frequently Asked Questions

How do I calculate hours worked in Excel?
Subtract the start time from the end time and multiply by 24. With start in B2 and end in C2, use =(C2-B2)*24, then format the result as a number.

How do I calculate a shift that ends the next day?
With start in B2 and end in C2, use =MOD(C2-B2,1)*24. It returns elapsed hours across midnight for a shift under 24 hours.

How do I subtract an unpaid lunch break?
Enter the break duration as an Excel time, such as 0:30, in D2. With start in B2 and end in C2, use =((C2-B2)-D2)*24 to deduct it and return decimal hours.

Why does my total show the wrong number after 24 hours?
Excel may be displaying a duration with a clock format that wraps at 24 hours. Format the summed duration as [h]:mm, or convert it to decimal hours by multiplying the duration total by 24.

Can Excel determine whether hours qualify for overtime?
Excel can compare a total with a threshold you enter, but it cannot establish which overtime rules apply. Confirm the relevant policy and requirements before using the result for payroll.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.