How to Calculate Overtime in Excel

Excel can split a week at 40 hours and price both parts in seconds, if the formulas are built right. This guide gives you a simple sheet layout, the exact formulas for day totals, regular hours, overtime hours and gross pay, and the fixes for the errors that make spreadsheet totals quietly wrong.

By Johnson Ramzan · Updated November 13, 2026

Open the Overtime Calculator

Home / Guides / Overtime in Excel

Plenty of small teams still run payroll from a spreadsheet, and there is nothing wrong with that - as long as the sheet respects the one rule that matters. Under US federal law, overtime is calculated on the workweek: hours past 40 in a single week are paid at one and a half times the regular rate. An Excel sheet that calculates overtime correctly is really just that rule expressed in formulas: total each day, total the week, split the week at 40, then price the two parts at two different rates.

One Excel fact explains every formula below. Excel stores a time of day as a fraction of a 24-hour day, so 6:00 PM is stored as 0.75. Subtracting start from end gives a fraction of a day, and multiplying by 24 turns it into ordinary decimal hours you can pay on. Forget the x24 once and a 46-hour week becomes 1.92 - the single most common spreadsheet payroll error.

Set up the sheet

Keep the layout boring. One row per day, one column per fact, and a small summary block underneath. Boring sheets are the ones that survive being reused every week.

ColumnWhat goes in itExample
A - DayDay of the weekMonday
B - Time inStart time, entered as a real time8:00 AM
C - Time outEnd time, entered as a real time5:30 PM
D - Lunch (minutes)Unpaid meal break in minutes30
E - Day totalFormula, decimal hours9

The day total formula in E2 is =(C2-B2)*24 - D2/60. The first part turns the span between out and in into hours; the second part turns lunch minutes into hours and takes them off. Copy it down all seven rows. For a shift that crosses midnight, plain subtraction goes negative, so use =MOD(C2-B2,1)*24 - D2/60 instead - MOD rolls the negative result into the next day, which is exactly what an overnight shift is.

The three formulas that do the real work

With day totals in E2 to E8, the summary block needs only three ideas. The weekly total is =SUM(E2:E8). Regular hours are =MIN(total, 40) - the week counts up to 40 and no further at the straight rate. Overtime hours are =MAX(total-40, 0) - everything past 40, and never less than zero on a short week. Put the hourly rate in its own cell so you can change it without touching formulas, and gross pay becomes regular hours x rate + overtime hours x rate x 1.5.

That is the entire engine. Notice what the formulas never do: they never split a single day at 8 hours, because federal overtime is weekly, and they never touch the pay period total, because a biweekly sheet must run this same block twice, once per week. Our guide to overtime in a biweekly pay period shows that two-block layout in full.

A factory worker operating a machine in a workshop - How to Calculate Overtime in Excel
A good overtime sheet is mostly structure: honest day totals, one weekly split at 40, two rates.

A full worked week

Take an employee on $18.00 an hour with a 30-minute unpaid lunch. The day totals come off the sheet exactly as the formula produces them.

DayInOutLunchDay total
Monday8:00 AM5:30 PM30 min9
Tuesday8:00 AM6:00 PM30 min9.5
Wednesday9:00 AM5:30 PM30 min8
Thursday7:30 AM6:00 PM30 min10
Friday8:00 AM6:00 PM30 min9.5
Weekly total46

The summary block then reads: regular hours =MIN(46,40) = 40, overtime hours =MAX(46-40,0) = 6. Regular pay is 40 x $18.00 = $720.00. The overtime rate is $18.00 x 1.5 = $27.00, so overtime pay is 6 x $27.00 = $162.00. Gross pay for the week is $882.00. If the sheet had simply priced all 46 hours at straight time it would show $828.00 - the missing $54.00 is the half-rate premium on the 6 overtime hours, and it is the first thing to look for whenever a spreadsheet total feels light.

Formatting traps and quiet errors

Three traps catch almost everyone once. The first is formatting: if a total cell is formatted as a time, anything past 24 hours wraps around, so 46 hours displays as 22:00. Format hour totals as plain numbers (they are decimal hours after the x24), or use the custom format [h]:mm if you want hours and minutes. The second trap is typing times as text - "8.00" typed into a cell is not a time, and formulas either fail or treat it as something else entirely. Type real times, with a colon and AM or PM. The third trap is rounding inside the sheet: rounding each day and then splitting is not the same as splitting the true week, and rounding that only ever rounds down is not legal rounding at all. If your workplace rounds punches, round the in and out times to the nearest interval and let the totals be exact.

One more limit is worth knowing. This simple sheet prices one rate. If the employee worked two jobs at two rates, or earned a bonus, the regular rate itself changes and a plain 1.5 x base formula underpays - that is the blended overtime rate, which has its own guide. And if you would rather not maintain formulas at all, the overtime calculator does the same split and pricing from three inputs, which makes it a good second check on any sheet you build.

Check your sheet before you trust it

Test any new overtime sheet against a week you have already priced by hand - the 46-hour week above works well. Enter the same punches, and the sheet should return 40 regular hours, 6 overtime hours and $882.00 gross at $18.00 an hour. Then test a short week, say 32 hours, and confirm overtime shows zero rather than a negative number or an error. Finally, run one real week through both the sheet and the overtime calculator and compare gross pay to the cent. When a hand check, a spreadsheet and a calculator all agree, the sheet is doing its job. For the underlying rule the formulas express, the time calculator homepage and the guides below cover the rest of the toolkit.

Frequently asked questions

What is the Excel formula for overtime hours?

If the weekly total sits in cell E9, regular hours are =MIN(E9,40) and overtime hours are =MAX(E9-40,0). Gross pay is then regular hours times the rate, plus overtime hours times the rate times 1.5. Those three formulas are the whole engine - everything else on the sheet just feeds the weekly total.

Why does my hours total show as a time like 22:00?

Because the cell is formatted as a time, and time formats wrap around every 24 hours. A 46-hour week displays as 22:00. Either multiply the time difference by 24 and format the result as a plain number, which gives you decimal hours like 46, or use the custom format [h]:mm, which lets the hours run past 24.

How do I calculate overtime for a shift that crosses midnight in Excel?

Wrap the subtraction in MOD: =MOD(C2-B2,1)*24 gives the true length of a shift that runs past midnight, because MOD treats a negative result as time on the next day. Then subtract the lunch break as usual. Without MOD, a 10 PM to 6 AM shift produces a negative number or an error.

Can one Excel sheet handle a biweekly pay period?

Yes, but build it as two separate weekly blocks, each with its own total, regular hours and overtime hours, then add the two results. Never run the MIN and MAX split on the combined 80-hour total - that averages the two weeks, which federal law does not allow for most jobs.

Should Excel round my times before calculating overtime?

Only if your workplace rounding policy does, and then round the punches, not the totals. Rounding to the nearest 5, 6, 10 or 15 minutes is legal when it is neutral over time. Rounding every day down, or rounding the weekly total, quietly cuts overtime and is where spreadsheet payroll most often goes wrong.

About the author
Johnson Ramzan builds and maintains every calculator on Time Calculator Tools himself, and he tests each one against worked examples he has done by hand before it is allowed near a reader. His guides follow US Department of Labor guidance on hours worked, overtime and rounding, and he writes them the way he would want a payslip explained to him: plain English, real numbers, and no step skipped. When a reader writes in with a shift pattern the tools handle badly, fixing it goes to the top of his list.
Last updated: November 13, 2026

Related guides

How to Calculate Overtime Pay, Step by Step

The plain method behind the formulas: total the week, split at 40, price both parts.

Read the guide

How to Calculate Time and a Half

What time and a half means at common pay rates, with a quick rate table.

Read the guide

Overtime in a Biweekly Pay Period

Why each week stands alone, and how to lay out a two-week sheet without averaging.

Read the guide

The Blended Overtime Rate, Explained

Two pay rates in one week means one weighted rate - here is the formula and a full example.

Read the guide