Back to Blog
How to Calculate Hours Worked: Formulas, Excel and Examples
Productivity

How to Calculate Hours Worked: Formulas, Excel and Examples

Shreyansh Rane
••Updated Nov 24, 2026
Share:

If you need to calculate hours worked for payroll, a client invoice, or a weekly timesheet, start with the same steps every time. Subtract the start time from the end time, convert that duration into hours, then subtract unpaid breaks. After that, you can total the week, separate overtime, and turn the hours into pay.

This guide shows how to calculate hours worked by hand and in Excel, with examples for decimal conversion, lunch breaks, overnight shifts, and overtime. The formulas include =(C2-B2)*24, MOD for shifts that cross midnight, and SUM with [h]:mm formatting. Those hours usually belong on a timesheet. If you need a refresher on the document itself, start with what a timesheet is and how to fill one.

The Basic Formula to Calculate Hours Worked

The core formula is:

Hours worked = (end time - start time) - unpaid breaks

Elapsed time is the clock difference between when work began and when it ended. Unpaid time, usually a lunch break, comes out of that total. Paid breaks stay in.

  • Start time. 9:00 AM

  • End time. 5:30 PM

  • Elapsed time. 8 hours 30 minutes

  • Unpaid lunch. 30 minutes

  • Hours worked. 8.00 hours

From 9:00 AM to 5:30 PM is eight and a half hours on the clock. Subtract a 30-minute unpaid lunch and you have an 8 hour work day.

To calculate work hours by hand, convert everything to minutes first:

  1. Convert the start and end times to minutes past midnight.

  2. Subtract the start from the end. If the shift ends the next day, add 1,440 minutes (24 hours) first.

  3. Subtract unpaid break minutes.

  4. Divide by 60 to get hours.

In the same example, 5:30 PM is 1,050 minutes past midnight and 9:00 AM is 540 minutes. The difference is 510 minutes. Subtract 30 lunch minutes and you have 480 minutes, or 8.00 hours.

How to Convert Hours and Minutes to Decimal Hours

Payroll systems, invoices, and most spreadsheets expect decimal hours, not a time written as 8:30. Divide the minutes by 60 and add the whole hours.

Decimal hours = hours + (minutes / 60)

  • 8 hours 15 minutes. 8.25 hours

  • 8 hours 20 minutes. 8.33 hours

  • 8 hours 30 minutes. 8.50 hours

  • 8 hours 45 minutes. 8.75 hours

  • 15, 30, and 45 minutes. 0.25, 0.50, and 0.75 hours

  • 6 minutes. 0.10 hours

If you pay to two decimal places, 8 hours 20 minutes becomes 8.33, not 8.20. Writing 8.20 would mean 8 hours and 12 minutes, because 0.20 x 60 = 12. That mix-up is common and adds up across a team.

In Excel, if cell A2 already contains a time value such as 8:30, =A2*24 returns 8.5. To turn a decimal back into a time, use =A2/24 and format the cell as h:mm.

How to Calculate Work Hours After Breaks

If a break is unpaid, subtract it. If it is paid, leave it in the hours worked. Take a shift from 8:45 AM to 5:15 PM with a 30-minute unpaid lunch:

  • Elapsed time. 8 hours 30 minutes (8.50 hours)

  • Unpaid break. 30 minutes (0.50 hours)

  • Hours worked. 8.00 hours

A 45-minute unpaid lunch on the same clock times would leave 7.75 hours, not 8.00.

What clock times make an 8 hour work day?

People often look for an 8 hour work day calculator because 9:00 AM to 5:00 PM is not automatically eight paid hours. That span is eight elapsed hours, so an unpaid lunch means you need a later finish or an earlier start to reach 8.00 hours worked.

  • 30-minute unpaid lunch. 9:00 AM to 5:30 PM, or 8:30 AM to 5:00 PM, equals 8.00 hours worked

  • 45-minute unpaid lunch. 9:00 AM to 5:45 PM equals 8.00 hours worked

  • 60-minute unpaid lunch. 9:00 AM to 6:00 PM, or 8:00 AM to 5:00 PM, equals 8.00 hours worked

  • No unpaid break. 9:00 AM to 5:00 PM equals 8.00 hours worked

Paid short breaks stay in the total; only an unpaid meal break comes out.

How to Calculate Hours Worked in Excel

Excel stores time as a fraction of a 24-hour day, so 12:00 PM is 0.5 and 6:00 AM is 0.25. A raw subtraction such as C2-B2 looks like a time of day until you multiply by 24. The standard Excel formula to calculate hours worked is:

=(C2-B2)*24

Put the date in column A, start time in B, end time in C, unpaid break in D, and hours worked in E. Format B and C as h:mm AM/PM. Enter real Excel times, not text that only looks like time. If B2 is 9:00 AM and C2 is 5:30 PM, =(C2-B2)*24 returns 8.5. Format column E as a Number with two decimal places.

For a fuller spreadsheet walkthrough, see how to track time in Excel.

Subtract a break in the same formula

If D2 is a time value such as 0:30, use =(C2-B2-D2)*24. If D2 is already a decimal number of hours, such as 0.5, use =(C2-B2)*24-D2.

Mixing the two break formats often produces a result that is 24 times too small or too large, so pick one method and stick to it.

Overnight shifts with MOD

A regular subtraction fails on any shift that crosses midnight, because the end time is earlier than the start time. If someone starts at 10:00 PM and finishes at 6:30 AM, C2-B2 is negative. Use:

=MOD(C2-B2,1)*24

For 10:00 PM to 6:30 AM, that returns 8.5 hours. Subtract a 30-minute unpaid break with =MOD(C2-B2,1)*24-D2*24 when D2 is a time such as 0:30, which returns 8.00 hours. If D2 is already a decimal, drop the final 24 and subtract D2 only. Subtract the break after you have the overnight hours. Putting a decimal break inside MOD, as in =MOD(C2-B2-D2,1)24, can return the wrong duration.

An equivalent version without MOD is =IF(C2>=B2,(C2-B2)*24,(C2+1-B2)*24). The +1 adds a full day when the shift ends the next morning. Both work in Excel and Google Sheets.

Weekly totals and [h]:mm formatting

A weekly work hours calculator in Excel is a SUM of the daily results. If column E already contains decimal hours, total a Monday-to-Sunday week with =SUM(E2:E8) and keep the Number format.

If you instead store each day's duration as an Excel time (C2-B2-D2, without multiplying by 24), use the custom format [h]:mm. The format h:mm resets after 24 hours, so a 42-hour week can display as 18:00 instead of 42:00. Do not SUM decimal hours and then apply [h]:mm. Excel would read 42.5 as 42.5 days, not 42.5 hours.

How to Calculate Working Hours for the Week

Once each day is correct, weekly hours are just addition. Here is a sample week for someone who usually works eight hours a day, with a 30-minute unpaid lunch.

  • Monday, 12 Oct 2026. Start: 9:00 AM; End: 5:30 PM; Break: 0:30; Hours worked: 8.00

  • Tuesday, 13 Oct 2026. Start: 9:00 AM; End: 6:00 PM; Break: 0:30; Hours worked: 8.50

  • Wednesday, 14 Oct 2026. Start: 9:00 AM; End: 5:30 PM; Break: 0:30; Hours worked: 8.00

  • Thursday, 15 Oct 2026. Start: 8:30 AM; End: 5:30 PM; Break: 0:30; Hours worked: 8.50

  • Friday, 16 Oct 2026. Start: 9:00 AM; End: 5:00 PM; Break: 0:30; Hours worked: 7.50

  • Saturday and Sunday. Off; Hours worked: 0.00

  • Week total. 40.50 hours

Tuesday is 8.50 hours after lunch, and Friday is 7.50 hours. The week totals 40.50 hours, or 40.00 regular hours and 0.50 overtime if overtime starts after 40 hours in the workweek. For two shifts in one day, use two rows and let SUM pick up both.

How to Calculate Hours Worked and Pay

For an hourly rate, multiply regular hours by the regular rate, then multiply overtime hours by the overtime rate.

  • Regular pay. Regular hours x hourly rate

  • Overtime pay. Overtime hours x hourly rate x overtime multiplier

  • Total pay. Regular pay + overtime pay

A widely used overtime multiplier is 1.5, often called time and a half, and some schedules also use double time, or 2.0. When overtime begins varies. US federal rules for many nonexempt employees use a 40-hour workweek, and some states or countries also require daily overtime, for example after 8 hours in a day. Use the rule that applies to the employee. The figures below are for the math, not a legal determination.

  • Hourly rate. $22.00

  • Hours worked. 44.00

  • Regular hours. 40.00

  • Overtime hours. 4.00

  • Regular pay. 40 x $22.00 = $880.00

  • Overtime pay. 4 x $22.00 x 1.5 = $132.00

  • Total pay. $1,012.00

In Excel, if E9 is the weekly total in decimal hours and G1 is the hourly rate:

  • Regular hours. =MIN(E9,40)

  • Overtime hours. =MAX(0,E9-40)

  • Total pay. =MIN(E9,40)*G1+MAX(0,E9-40)*G1*1.5

If your policy uses daily overtime after 8 hours, calculate it on each row with =MAX(0,E2-8), then SUM those overtime cells. Do not also apply a 40-hour weekly rule to the same hours unless your policy says to, or you will count some overtime twice.

For a quicker check of overtime pay at time and a half or double time, use the overtime calculator to confirm the spreadsheet before payroll is finalized.

Common Mistakes When You Calculate Hours Worked

Most errors come from format problems, not from hard math.

  • Treating 9:00 AM to 5:00 PM as 8.00 paid hours when lunch is unpaid.

  • Writing minutes as decimals, such as 8.30 instead of 8.50 for 8 hours 30 minutes.

  • Forgetting the unpaid break in the total or in the Excel formula.

  • Leaving overnight shifts as a negative number. Use MOD or add 1 day.

  • Entering times as text. Re-enter the value as a time, or use =TIME(9,0,0).

  • Formatting a weekly SUM as h:mm instead of [h]:mm when the cells contain time values.

  • Mixing decimal hours and time values in the same column. Pick one system per sheet.

Before payroll, scan any day far from the scheduled shift length, and any week well above or below 40 hours.

When a Spreadsheet Is More Work Than It Is Worth

A well-built workbook is enough for a small team with regular hours and one person who knows the formulas. It becomes a liability when rows are overwritten, copies of the file multiply, or you are repairing #VALUE! errors each pay period.

You can keep the same clock-in and clock-out method without maintaining the formulas yourself. The time card calculator totals daily hours, weekly hours, overtime, and optional pay as you type. If the team needs a shared record, time tracking software can capture the times and build the timesheet for you.

Tracko, for example, includes built-in timesheets, optional automatic time tracking, and timesheet reports by task, project, and user, so weekly hours do not have to be retyped into Excel for payroll or invoicing.

Frequently Asked Questions

How do you calculate hours worked from a start and end time?

Subtract the start time from the end time, then subtract unpaid breaks. Convert to decimal hours for payroll or billing: 8 hours 30 minutes minus a 30-minute lunch equals 8.00 hours.

What is the Excel formula to calculate hours worked?

Use =(C2-B2)*24, where B2 is the start time and C2 is the end time. Subtract a break with =(C2-B2-D2)*24 when D2 is a time such as 0:30, and format the result as a Number.

How do you calculate hours worked in Excel for an overnight shift?

Use =MOD(C2-B2,1)*24, then subtract the unpaid break in the same format you used on the other rows.

How do you calculate hours worked and pay, including overtime?

Total the workweek, split regular and overtime hours under your policy, then multiply each group by the correct rate. At $22 an hour, 44 hours, a 40-hour threshold, and time and a half, pay is $880 plus $132 overtime, or $1,012.

Why does my weekly work hours total look wrong in Excel?

If you stored durations as time values and used h:mm, Excel starts over after 24 hours. Use [h]:mm, or convert each day to decimal hours with *24 and SUM those numbers.

Does a 9:00 to 5:00 schedule always equal an 8 hour work day?

Only if there is no unpaid break. 9:00 AM to 5:00 PM is 8.00 elapsed hours, so a 30-minute unpaid lunch leaves 7.50 hours worked. End at 5:30 PM to keep 8.00 hours.

Final Thoughts

To calculate hours worked, subtract the start time from the end time, convert the duration to hours, and subtract unpaid breaks. The same steps scale from one day to a full week, and from a notepad to Excel. Keep breaks consistent, use MOD for overnight shifts, and format weekly time totals as [h]:mm when you are summing time values instead of decimals.

When the spreadsheet becomes the job, let recorded time produce the totals. Tracko can replace manual hour calculations with automatic time tracking and timesheet reports, so you spend less time checking formulas and more time reviewing the work.

Tags

#Hours Worked#Excel#Payroll#Time Tracking#Overtime

Categories

Productivity
Share:
S

Shreyansh Rane

Author