EXCEL HOW-TO

How to Calculate Hours Worked in Excel for Payroll

Excel formulas for payroll hours: TIME values, (out-in)*24, MOD for overnight shifts, decimal hours, text-time pitfalls, and the point a 200-person file stops being safe.

Excel timesheet using TIME formulas to turn check-in and check-out into decimal hours for payroll

Store Times as Times, Not as Text or Pseudo-Decimals

Excel can calculate payroll hours only when check-in and check-out are real time values. A true Excel time is a fraction of one day: 09:00 is 0.375, 18:00 is 0.75. If the cell looks like 9:00 but is stored as text, subtraction returns a #VALUE! error or a zero that looks like a missing shift. If someone types 9.15 meaning a quarter past nine, Excel treats it as 9.15 hours, which is 9 hours 9 minutes, not 9 hours 15 minutes.

Set the input columns to a time format and, where possible, use data validation so only time values can be entered. If you receive a CSV from a device, run a conversion step: TIMEVALUE on text times, or a documented parse if the file uses 0915 as a four-digit string. Do not fix individual cells by retyping. A payroll file that depends on silent repairs will drift the moment a new clerk owns it. Put the conversion on a helper tab so the raw CSV remains visible beside the time values you actually calculate from.

Keep the work date in a separate date column. Do not combine date and time in a way you cannot audit, and do not rely on Excel’s 1900 date system to invent the next day for you without a formula. The 1900 system treats dates as serial numbers and incorrectly assumes 1900 was a leap year. That bug rarely hits modern attendance, but mixing date serials with text times is a common way an overnight shift becomes a 16-hour negative.

  • Enter check-in and check-out as Excel time values, not text
  • Never type 9.15 to mean 09:15; that is 9.15 hours, not 9:15
  • Convert CSV text times with a repeatable TIMEVALUE or parse step
  • Keep work date and time in columns you can audit independently

The Core Formula: (Out − In) × 24

If C2 is check-in and D2 is check-out on the same calendar date, paid gross hours are =(D2-C2)*24. Multiplying by 24 converts the day-fraction into decimal hours. A check-in at 09:10 and check-out at 18:10 is 9.00 hours before breaks. Format the result as a number with two decimal places, not as a time, if payroll expects 9.00 rather than 9:00. A cell showing 0.375 that you thought was 9 hours is the unconverted day-fraction. Train reviewers to look at the number format first; many disputes are format, not policy.

Subtract unpaid breaks after the duration is in hours. If E2 is break minutes, paid hours are =(D2-C2)*24-(E2/60). Example: 09:10 to 18:10 with 45 unpaid minutes is 9.00 - 0.75 = 8.25 decimal hours. That is 8 hours 15 minutes, not 8.15. Payroll engines almost always want 8.25. If your salary software wants hours and minutes in separate columns, split with INT for hours and ROUND((hours-INT(hours))*60,0) for minutes after the decimal exists. Do that split last, from the same paid-hours cell, so the two representations cannot drift.

Do not round C2 and D2 before subtracting. Rounding 09:07 to 09:00 and 18:07 to 18:15 creates a different duration from rounding the final 8.25. For a 22-day month, punching every arrival and exit to the next 15 minutes can move payable time by more than an hour. Apply MROUND, CEILING, or FLOOR to the paid-hours result according to a written policy, then copy that policy into the payroll import notes so finance is not asked to guess which way you rounded.

  • Same-day gross hours: =(D2-C2)*24
  • Paid hours: =(D2-C2)*24-(E2/60) when E2 is unpaid break minutes
  • 8 hours 15 minutes is 8.25 decimal hours, not 8.15
  • Round the paid result, not each punch, using one documented rule

Overnight Shifts: Use MOD, Not a Negative Duration

If check-out is earlier than check-in, a naive (D2-C2)*24 becomes negative. A 22:00 start and 06:00 finish is not minus 16 hours. It is 8.00 hours that crossed midnight. The compact formula is =MOD(D2-C2,1)*24. MOD with 1 wraps a negative day-fraction back into a positive duration under 24 hours. Add the break subtraction after that: =MOD(D2-C2,1)*24-(E2/60). Copy this down only after you have seen 8.00 on the night row, not -16.00.

An equivalent IF form is easier to explain in training: =IF(D2<C2,(D2+1-C2)*24,(D2-C2)*24). Adding 1 adds one day to the check-out serial. Use whichever form your team will actually maintain. Test three rows before you copy down: a same-day 09:00-18:00, a night 22:00-06:00, and a missing check-out. The missing out must not become 22 hours because a blank cell was treated as 00:00. That single blank is how a night shift becomes an overtime dispute.

Blank handling is part of the formula, not a later cleanup. Wrap the calculation so both times must exist before hours are returned. A practical pattern is: if check-in or check-out is empty, write EXCEPTION in the hours cell; otherwise apply MOD and subtract the break. Payroll should receive that exception token, not a guessed 0.00 or a full scheduled shift. Zero hours and missing punches are different facts. Excel will not distinguish them unless you force it to, and payroll cannot post a token it never received.

  • Overnight duration: =MOD(D2-C2,1)*24
  • Alternative: =IF(D2<C2,(D2+1-C2)*24,(D2-C2)*24)
  • Never let a blank check-out calculate as midnight
  • Return EXCEPTION when either punch is missing instead of 0.00

Decimal Hours, Overtime Columns, and Rounding

Once paid hours exist, split regular and overtime in columns, not in a comment. If the daily threshold is 8.00, regular hours can be =MIN(F2,8) and overtime =MAX(F2-8,0), where F2 is paid hours. Example: paid 9.50 becomes 8.00 regular and 1.50 overtime. Do not put 9.50 in one column and hope payroll notices the overtime policy. If overtime needs approval, add a column that is 1 or 0, and multiply: overtime payable =MAX(F2-8,0)*approval.

Weekly overtime cannot be calculated with a daily MIN/MAX copied down. You need a SUMIFS of paid hours for the employee and the policy week, then a residual above 40.00 or whatever threshold you use. Excel can do this, but it is where files start to break: one wrong week-start date, and every residual is wrong. If you must do it in Excel, freeze the week-start in a named cell and test an employee who works a night shift across Sunday–Monday.

Convert minutes to decimals only from a true duration. 90 minutes is 1.50 hours. A text value of 1:30 formatted as time is 0.0625 of a day; multiplying by 24 yields 1.50. A text value of 1.30 means 1.3 hours if you treat it as a number, which underpays 12 minutes. Publish a one-page formula standard so every site file does not invent a fourth method in row 400. If two plants submit 1.30 and 1:30 for the same policy, payroll will pay two different amounts and both will look internally consistent.

  • Daily split: regular =MIN(paid,8), overtime =MAX(paid-8,0)
  • Gate overtime with an approval flag if policy requires it
  • Weekly thresholds need SUMIFS, not a daily formula copied down
  • Standardise decimal conversion so 1:30 never becomes 1.30 hours

The Pitfalls That Silently Change Pay

Text times are the most common silent failure. A CSV column that looks aligned still may be text. ISTIME and a VALUE or TIMEVALUE conversion should be a visible helper column, not a hope. Another failure is 12-hour times without AM/PM. 6:00 as evening check-out stored as 06:00 creates a 3-hour shift for someone who started at 15:00. Force 24-hour input or require AM/PM and test a 15:00–18:00 row every time you change the template.

The 1900 date system bites when people paste dates from mixed locales or when a device export includes seconds and a date in one cell. Excel may store 27-08-2026 22:00 as a serial datetime. Subtracting a time-only check-out from a datetime check-in is not the same as subtracting two times. Split DATE and TIME with INT(datetime) and MOD(datetime,1) before you apply the hours formula. If one column is datetime and the other is time, overnight logic will be wrong even when both values “look fine.”

Copied templates also copy broken named ranges and hidden rounding. A sheet that uses ROUND(F2,2) in one tab and ROUNDDOWN(F2,2) in another will not match the payroll register. Protect the formula columns. Colour input cells. Put the policy thresholds in a parameter sheet. If supervisors can overwrite a formula with a typed 8 because “we know he worked a full day,” you no longer have a calculation. You have an honour system with extra steps.

  • Detect text times and 12-hour ambiguity before calculating
  • Split datetime serials into date and time before subtracting
  • Keep rounding functions identical across every tab
  • Lock formula columns so typed overrides cannot masquerade as hours

When Excel Stops Being a Safe Payroll Calculator

Excel remains a reasonable calculator for a single site, a simple same-day shift, and a headcount a reviewer can actually see. It stops being safe when you add multi-site deployments, overlapping shifts, overtime approvals, leave that must not also count as LOP, and roughly 200 employees whose exceptions arrive by chat. At that point the formula is not the bottleneck. Version control, identity mapping, and exception workflow are. A perfect MOD formula cannot tell you which of three emailed files is final.

Watch for the operational signs, not a magic headcount. Two people edit the file. Night rows still go negative. Overtime is typed, not derived. A biometric export is pasted and then hand-aligned to names. Contractors and employees share one sheet. Month-end takes more than a day because nobody trusts the totals. Those are process failures. Replacing a formula with a slightly cleverer formula will not fix them, and a 200-row file with those symptoms is already a payroll risk.

The software path is to capture punches once, apply the same hours math in a rules engine, and export decimal hours that already match what Excel would have produced on a clean row. Attend Mitra does that connected work: verified attendance, shift thresholds, leave, and approved overtime become a payroll-ready file without a master workbook that only one person understands. Keep Excel as an analysis tool if you want. Stop using it as the system of record for payable time when the exceptions no longer fit on one screen. The same arithmetic without spreadsheet pitfalls is in how to calculate employee hours for payroll. When the workbook itself is the problem, use Excel attendance sheet alternative and how to convert timesheets into payroll. Try the overtime calculator on a sample week first.

  • Excel is fine for a simple site; it fails at multi-site exceptions and dual editors
  • Typed overtime and pasted device dumps are signs the workbook is no longer calculating
  • Move capture, rules, and approval into software; keep Excel for analysis if needed
  • The payroll file should come from the same rules that a clean Excel row would have used

Frequently Asked Questions

How to calculate hours worked in Excel for payroll?
Store check-in and check-out as time values, use =(out-in)*24 for same-day shifts, subtract unpaid break minutes divided by 60, and round only the final paid hours. Use MOD for overnight shifts and return an exception when a punch is missing.
What is the Excel timesheet hours formula?
The core formula is =(D2-C2)*24 for same-day times in C2 and D2. For overnight, use =MOD(D2-C2,1)*24. Subtract E2/60 if E2 is unpaid break minutes. Format the result as a decimal number such as 8.25, not as a clock time.
How do you calculate working hours in Excel?
Convert both punches to Excel times, subtract, multiply by 24, then subtract unpaid breaks. Pair split shifts as two rows instead of first-in last-out. Do not type 9.15 to mean 09:15, and do not treat a blank check-out as midnight.
What is the timesheet formula in Excel for payroll?
Paid hours, then a split: regular =MIN(paid, threshold) and overtime =MAX(paid-threshold,0), optionally multiplied by an approval flag. Weekly overtime needs SUMIFS by employee and week, not a daily formula copied down.
When does Excel break for payroll hours?
When multiple editors, multi-site rosters, overnight pairing, overtime approvals, and leave collide in one workbook — often around a few hundred employees. Formulas still work on clean rows; the process around identity, exceptions, and versions does not.

Related guides

Ready to put this into practice?

Start your free trial or book a live demo with our team.