How to Calculate Work Time in Excel and Google Sheets

A spreadsheet is still the most flexible timesheet ever made - if you know the one idea behind how it handles time. This guide shows how to calculate work time in Excel and Google Sheets properly: the core formula, overnight shifts, lunch breaks, weekly totals, overtime splits and pay, plus the three errors that ruin almost every homemade timesheet.

By Johnson Ramzan · Updated October 27, 2026

Open the Work Time Calculator

Home / Guides / Work Time in Excel

People usually arrive at a spreadsheet timesheet for one of two reasons. Either they are checking their own pay and want something better than scribbles on a calendar, or they run a small team and cannot justify payroll software yet. Both are good reasons. A spreadsheet never forgets a formula, totals a week without complaint, and keeps a permanent record. The catch is that spreadsheets handle time in a way that surprises almost everyone the first time: a cell containing 9:00 AM is not storing "nine" of anything. Understand that single fact and every formula in this guide becomes obvious.

Here is the fact. Excel and Google Sheets store times as fractions of one day. Midday is 0.5. Six in the evening is 0.75. An eight-and-a-half-hour shift is about 0.354. So when you subtract a start time from an end time, you get a fraction of a day, and to turn that fraction into hours you multiply by 24. Every timesheet formula below is built on that one move.

Lay out the sheet first

Set up six columns and keep them in the same order every week: A for the date, B for start time, C for end time, D for lunch in minutes, E for total hours, and F for pay. Type times in a format the sheet recognises, such as 9:00 AM or 17:30. Type lunch as a plain number of minutes, 30 or 45, because minutes are easier to adjust than time values. One row per day, seven rows per week, and a total row underneath. Our work time calculator follows this same layout if you want to compare results while you build yours.

The one formula that does the work

In cell E2, the total for the first day, enter:

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

Read it in two halves. (C2-B2)*24 is the full length of the shift in decimal hours. D2/60 converts your lunch minutes into hours so they can be subtracted. Test it on a standard day: start 9:00 AM, end 5:30 PM, lunch 30. The span is 8.5 hours, the lunch is 0.5 hours, and the formula returns 8. That is the whole engine of the timesheet. Copy the cell down the column and every day works the same way, whether the shift is four hours or fourteen.

A hand inserting a time card into a digital punch clock - How to Calculate Work Time in Excel and Google Sheets
A simple six-column layout is all a spreadsheet timesheet needs - the formulas do the heavy lifting from there.

Shifts that run past midnight

The basic formula breaks on a night shift, because the end time is earlier than the start time and the subtraction goes negative. Excel shows #### in the cell and gives up. The fix is one function: MOD, which wraps the negative result around into the next day. The night-shift version of the formula is:

=MOD(C2-B2,1)*24 - D2/60

Try it on a 10:00 PM to 6:30 AM shift with a 30-minute lunch. MOD turns the difference into 8.5 hours, the lunch comes off, and the result is 8. This formula is safe to use for every row, day shifts included, so the simplest approach is to use the MOD version everywhere and never think about it again. If you want the thinking behind overnight shifts rather than just the formula, our guide to work time across midnight works through the method by hand.

Weekly totals, the overtime split and pay

With a week of daily totals in E2 to E8, the rest is three short formulas. The weekly total is =SUM(E2:E8). The regular hours are =MIN(total,40) - MIN simply refuses to let regular hours exceed 40. The overtime hours are =MAX(total-40,0) - MAX refuses to let overtime go below zero. Gross pay is then regular hours times your rate, plus overtime hours times one and a half times your rate.

Run it on a real week. Suppose the daily totals are 8.00, 8.00, 8.50, 9.00, 7.00 and 2.00 on a Saturday morning, totalling 42.50 hours, and the rate is $19 an hour. Regular pay is 40 x $19 = $760.00. Overtime is 2.50 hours at $28.50, which is $71.25. Gross pay is $831.25. Notice how little room there is for argument once the sheet is built: change any start or end time and every figure downstream updates, which is exactly why a spreadsheet beats a calculator and a notebook for checking a full pay period. You can cross-check any week in seconds with the work time calculator, and if the two disagree, one of them has a typing error worth finding.

If you prefer hours and minutes to decimals

Some people hate decimal hours, and for totals under a day you can keep everything in hours and minutes instead. Skip the *24 and format the result cell as a duration. The danger appears at the weekly total: a normal time format rolls over at 24 hours, so a 43-hour week displays as 19:00 and looks like a mistake. The fix is a custom format with square brackets, [h]:mm, which tells the sheet to keep counting past 24. And beware the classic trap in the other direction: 7.75 hours is 7 hours 45 minutes, but 7:45 typed carelessly as 7.45 is 7 hours 27 minutes. Decimals and clock times look similar and are not interchangeable.

Rounding inside the sheet

If your employer rounds clock times to the nearest quarter hour, your sheet can mirror it. MROUND is the tool: =MROUND(E2,0.25) rounds a decimal total to the nearest quarter hour, and =MROUND(B2,TIME(0,15,0)) rounds an actual clock time. Round the punches rather than only the total if that is what your workplace does, because the two methods can differ by a few minutes on awkward shifts. One warning: never use FLOOR or CEILING alone for pay calculations. They round everything in one direction, and a timesheet that only ever rounds down is exactly the pattern that gets employers into trouble and employees short-paid.

The three errors everyone makes

Nearly every broken homemade timesheet has one of these. First, forgetting the *24, which produces totals like 0.35 and 1.77 that look like someone worked twenty minutes all week. Second, typing 8.30 to mean 8 hours 30 minutes; as a decimal, 8.30 hours is 8 hours 18 minutes, so the day quietly loses 12 minutes. Third, adding a lunch column as a time value and subtracting it twice - once inside the formula and once because the end time was already adjusted. Pick one place for the lunch to live, the minutes column, and let the formula do the subtracting. The general time calculator on our homepage is handy for sanity-checking a single day's span while you hunt for mistakes like these.

Frequently asked questions

Why does my Excel total show 0.35 instead of 8.5 hours?

Because Excel stores times as fractions of a day. Subtracting a start time from an end time gives you a fraction - 8.5 hours is 0.354 of a day - not a number of hours. Multiply the result by 24 to convert it into decimal hours: =(C2-B2)*24. Almost every strange result in a timesheet spreadsheet comes from forgetting that one step.

Why does my formula show #### or a negative time?

That happens when the end time is earlier than the start time, usually on a night shift, so the subtraction goes negative and Excel refuses to display it. Wrap the difference in the MOD function: =MOD(C2-B2,1)*24. MOD rolls the result into the next day, which is exactly what an overnight shift needs.

How do I round times to the nearest 15 minutes in Excel?

Use MROUND on your decimal hours: =MROUND(E2,0.25) rounds a total to the nearest quarter hour. To round the clock times themselves before calculating, use =MROUND(B2,TIME(0,15,0)) on the start and end cells. Avoid FLOOR or CEILING on their own for pay, because rounding everything one way only is not a neutral rounding policy.

Can Google Sheets calculate work time the same way?

Yes. Every formula in this guide - the subtraction, the times-24 conversion, MOD for overnight shifts, MIN and MAX for the overtime split - works in Google Sheets exactly as in Excel. The only difference is formatting: in Sheets you choose Format, then Number, then Duration to display totals as hours and minutes.

How do I add up times that go over 24 hours in Excel?

Format the total cell with a custom format of [h]:mm. The square brackets tell Excel to keep counting past 24 instead of rolling back to zero, so a 43-hour week displays as 43:00 rather than 19:00. Without the brackets, weekly totals in hours-and-minutes format are always 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: October 27, 2026

Related guides

How to Calculate Work Time in Decimal Hours

The conversion payroll runs on: turning hours and minutes into decimals like 7.75, and back again, without the usual traps.

Read the guide

The Work Time Calculator Formula, Explained

The plain arithmetic behind every timesheet and spreadsheet: gross span, minus unpaid breaks, split at 40 hours.

Read the guide

How to Calculate Work Hours for a Month

Monthly totals for salaried checks, timesheet audits and budgeting, including months that contain five pay weeks.

Read the guide

How to Calculate Work Hours for 2 Weeks

How biweekly periods really work, why overtime is still weekly, and how to total two weeks without mixing them up.

Read the guide