ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Projects
  3. Calculate Hours Worked and Overtime in Excel

Calculate Hours Worked and Overtime in Excel

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

To calculate overtime in Excel, first get hours worked: =(End-Start)*24 turns a time difference into decimal hours. Total the week with SUM, then use =MAX(0,Total-40) or =IF(Total>40,Total-40,0) for overtime hours. Pay is regular hours times the rate plus overtime hours times the rate times 1.5, rounded to cents with ROUND.

Key takeaways

  • Excel stores a time as part of a day, so multiply a time difference by 24 to get hours as a number.
  • Subtract unpaid breaks in hours: minutes divided by 60.
  • =MOD(End-Start,1)*24 handles shifts that end after midnight.
  • Overtime hours are =MAX(0,Total-40); regular hours are =MIN(Total,40).
  • Overtime rules depend on your law and contract; 40 hours at 1.5× is only an example.
On this page+
  1. How Excel stores time
  2. Step 1: Set up the timesheet
  3. Step 2: Calculate hours worked each day
  4. Step 3: Total the week
  5. Step 4: Split regular hours and overtime with IF
  6. Step 5: Calculate pay and round it
  7. Step 6: Summarise pay for a team
  8. Rounding time to the nearest quarter hour
  9. Practise it

To calculate overtime in Excel, you first turn start and end times into hours worked, total the week, and then use IF (or MAX) to split the total into regular hours and overtime. A final ROUND keeps the pay to exact cents. This guide builds a one-week timesheet for one employee and a pay summary for a team. It is for supervisors, payroll and HR staff, and anyone checking their own hours.

How Excel stores time#

Excel stores a time as a fraction of a day. 12:00 noon is 0.5, 6:00 AM is 0.25, and one hour is 1/24. That is why subtracting two times gives a small decimal, not hours.

TimeWhat Excel stores
6:000.25
12:000.5
18:000.75
8 hours 45 minutes0.364583…

Multiply by 24 to turn a time difference into decimal hours: 0.364583 × 24 = 8.75. Decimal hours are easy to add, compare with 40 and multiply by a pay rate. Dates work the same way, with whole numbers for days, as explained in why Excel stores dates as numbers.

Step 1: Set up the timesheet#

Enter one row per day with the start time, end time and unpaid break in minutes. Type times with a colon, such as 8:30 or 17:15; Excel recognises them as times.

ABCDE
1DayStartEndBreak (min)Hours
2Mon8:3017:15308.25
3Tue8:0018:30459.75
4Wed9:0017:30308.00
5Thu7:4518:00309.75
6Fri8:0016:30308.00
7Total43.75

You can use 12-hour times too: type 5:15 PM with a space before PM. To stamp the current time into a cell, press Ctrl+Shift+; (Mac: ⌘;).

Step 2: Calculate hours worked each day#

Subtract the start from the end, multiply by 24, and take off the break. In E2:

Excel formula
=(C2-B2)*24-D2/60

The brackets make Excel subtract before it multiplies. The break is in minutes, so dividing by 60 turns it into hours. Monday is 8.75 hours on site minus 0.5 hours of break: 8.25. Fill down to E6.

If E2 shows a time such as 6:00 instead of 8.25, the cell picked up a time format from the cells it uses. Select column E and press Ctrl+Shift+~ (Mac: Control+Shift+~) for the General format, or choose Number with two decimals.

Shifts that end after midnight#

A shift from 22:00 to 6:00 gives a negative number with plain subtraction, because 6:00 is a smaller fraction than 22:00. MOD fixes it:

Excel formula
=MOD(C2-B2,1)*24

MOD with 1 keeps only the part of a day, so -0.6667 becomes 0.3333, which is 8 hours. The formula also works for normal day shifts, so you can use it everywhere.

Step 3: Total the week#

Add the daily hours with SUM. In E7:

Excel formula
=SUM(E2:E6)

The week comes to 43.75 hours. If you add time values instead of decimal hours, format the total as [h]:mm (Ctrl+1 or ⌘1 > Custom). The square brackets let the hours pass 24; without them, 43:45 would show as 19:45.

Step 4: Split regular hours and overtime with IF#

Regular hours are capped at the threshold, and overtime is anything above it. With the threshold of 40 in H1:

CellWhat it isFormulaResult
H2Regular hours=MIN(E7,$H$1)40.00
H3Overtime hours=IF(E7>$H$1,E7-$H$1,0)3.75

IF reads as: if the total is over 40, overtime is the total minus 40; otherwise it's 0. =MAX(0,E7-$H$1) gives the same result in a shorter formula. The threshold lives in its own cell, so a 38-hour or 44-hour rule needs one change. The IF function guide and the Excel IF function explained simply cover more IF patterns.

Some rules count overtime per day, for example over 8 hours in a day. Then use =MAX(0,E2-8) on each row and add those up instead.

Step 5: Calculate pay and round it#

Pay is regular hours at the normal rate plus overtime at a higher rate. With the hourly rate of 22.00 in H4 and the overtime multiplier of 1.5 in H5:

Excel formula
=ROUND(H2*H4+H3*H4*H5,2)

That is 40 × 22.00 = 880.00, plus 3.75 × 22.00 × 1.5 = 123.75, for 1,003.75.

ROUND with 2 decimals matters with rates like 18.75. Priya, in the exercise on this page, works 43.5 hours: 40 × 18.75 + 3.5 × 18.75 × 1.5 = 848.4375. Formatting would only show 848.44; ROUND stores exactly that, so payroll totals add up. How to round numbers in Excel explains ROUND, ROUNDUP and ROUNDDOWN.

You can also write the pay as one IF formula, which is the exercise:

Excel formula
=ROUND(IF(B2>40,40*C2+(B2-40)*C2*1.5,B2*C2),2)

Step 6: Summarise pay for a team#

For a team, put one row per employee with their weekly hours and rate, then fill the one-formula version down:

EmployeeHoursRatePay
Priya43.518.75848.44
Tom3821.00798.00
Aisha4619.50955.50
Mateo4024.00960.00

Mateo shows the boundary: exactly 40 hours is not over 40, so he gets no overtime. Check that your rule says "over 40" before you choose > rather than >=.

To bring in each person's rate automatically, look it up by employee ID from a staff list; the employee lookup sheet project builds exactly that. A weekly overtime total also makes a good line on a KPI summary sheet.

Rounding time to the nearest quarter hour#

Some workplaces round clock-in and clock-out times. On decimal hours, =ROUND(E2*4,0)/4 rounds to the nearest 0.25 hour (15 minutes): 8.2 becomes 8.25. Use ROUNDDOWN or ROUNDUP in place of ROUND if your policy always rounds one way.

Overtime rules come from local law and employment contracts, so the 40-hour threshold and 1.5× rate here are examples, not advice. Payroll work like this is part of the Excel skills for finance and accounting jobs.

Practise it#

Do the exercise on this page to work out overtime pay with IF and ROUND. Then practise the IF function, including IF that returns a calculation, and practise ROUND, ROUNDUP and ROUNDDOWN in a live spreadsheet.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Overtime is paid at 1.5× the hourly rate for hours over 40 in a week. In D2, work out Priya's weekly pay with IF: if her hours in B2 are over 40, pay 40 hours at the rate in C2 plus the extra hours at 1.5 times the rate; otherwise pay hours times rate. Round the result to 2 decimals with ROUND.

fx
ABCDE
1
Employee
Hours
Rate
Pay
2
Priya
43.5
18.75
3
Tom
38
21
4
Aisha
46
19.5
5
Mateo
40
24
6
7
8

Tip: Inside ROUND(…,2), use IF(B2>40, 40*C2+(B2-40)*C2*1.5, B2*C2). Priya's pay should come to 848.44.

Practise this in a lesson

LessonThe IF functionMake a cell show one result or another depending on a condition, like Pass/Fail or Over/Under budget.LessonROUND, ROUNDUP and ROUNDDOWNControl decimals properly, which isn't the same as formatting.Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.

Frequently asked questions

How do I calculate hours worked between two times in Excel?

+

Subtract the start time from the end time and multiply by 24: =(C2-B2)*24. Excel stores times as fractions of a day, so the 24 turns the result into hours, for example 8.75 for 8 hours 45 minutes.

Why does my total show 19:45 instead of 43:45?

+

A normal time format restarts at 24 hours, like a clock. Format the total with the custom format [h]:mm, or convert the hours to decimal numbers with *24 before you add them.

How do I calculate time worked across midnight?

+

Use MOD so the difference never goes negative: =MOD(C2-B2,1)*24. A shift from 22:00 to 6:00 then gives 8 hours.

Can Excel round hours to the nearest quarter hour?

+

Yes. =ROUND(E2*4,0)/4 rounds decimal hours to the nearest 0.25. Use ROUNDUP or ROUNDDOWN instead of ROUND if your policy always rounds one way.

Is overtime always paid after 40 hours?

+

No. The threshold, the multiplier and whether overtime is counted per day or per week depend on local law and your employment contract. Put the threshold and multiplier in their own cells so you can match your rules.

Sources

  • IF function - Microsoft Support
  • ROUND function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How Excel stores time
  2. Step 1: Set up the timesheet
  3. Step 2: Calculate hours worked each day
  4. Step 3: Total the week
  5. Step 4: Split regular hours and overtime with IF
  6. Step 5: Calculate pay and round it
  7. Step 6: Summarise pay for a team
  8. Rounding time to the nearest quarter hour
  9. Practise it

Keep reading

Projects· 6 min read

Build a Simple KPI Summary Sheet in Excel

A KPI summary sheet is a small block of formulas that reads a data table and shows the few numbers your manager asks about. Use SUMIFS for totals, COUNTIFS for counts, a ratio for rates and (new - old) / old for percent change. Put the month in one input cell so every KPI updates when you change it.

Projects· 6 min read

Build an Employee Lookup Sheet in Excel

An employee lookup sheet has a staff table and a small lookup card. You type an employee ID into one cell, and XLOOKUP formulas fill in that person's name, department and other details from the table. Add "Not found" as XLOOKUP's fourth argument so a wrong ID shows a clear message instead of #N/A.

Tests & careers· 6 min read

Excel Skills for Finance and Accounting Jobs

The key Excel skills for finance jobs are absolute ($) references for rates and totals, ROUND for real rounding rather than display formatting, SUMIFS for totals by account and period, pivot tables for summaries, percent change and % of total, lookups, and simple checks that prove a report adds up. Accuracy matters more than speed.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free