How to build a time card calculator in Excel

A spreadsheet time card is the best of both worlds: your own file, your own rules, and totals that add themselves. This guide gives you the exact layout and formulas - daily totals with lunch removed, decimal hours, the overtime split and gross pay - plus the fixes for the three errors everyone hits in the first week.

By Johnson Ramzan · Updated October 29, 2026

Open the Time Card Calculator

Home / Guides / Time Card Calculator in Excel

Plenty of people do not need payroll software. They need one honest sheet that takes the week's punches and answers four questions: how long was each day, how long was the week, how much of it is overtime, and what does it pay. Excel does all of that with five formulas, and once the sheet is built you just type times into it every week.

There is one idea to understand before any formula makes sense. Excel does not store 8:30 as "eight and a half hours". It stores it as a fraction of a day: 8:30 AM is 0.3542, noon is 0.5, and one full day is exactly 1. Every time formula in this guide is just arithmetic on those fractions, and the one conversion that matters - turning a fraction of a day into hours - is multiplying by 24. Keep that in mind and nothing below will surprise you.

Step 1: lay out the sheet

Put these headers in row 1, one per column: A Day, B Time In, C Lunch Out, D Lunch In, E Time Out, F Day Total (hours and minutes), G Day Total (decimal). Rows 2 to 6 are Monday to Friday; add rows 7 and 8 if you work weekends. Type times in a format Excel recognizes, like 8:00 AM or 17:30, and it will store them as time values rather than text. Below the days, leave three rows for the week total, the regular/overtime split, and pay.

Step 2: the daily total formula

The day total is the same span-minus-lunch sum you would do on paper. In cell F2, type:

=(E2-B2)-(D2-C2)

The first bracket is the full span of the shift, the second is the lunch, and the answer is the paid time - still stored as a fraction of a day. To see it as hours and minutes, format column F with the custom format [h]:mm. The square brackets are not decoration: without them, a total over 24 hours wraps around the clock and a 41-hour week displays as 17 hours.

For payroll you also want decimal hours, so in G2 put the same sum converted:

=((E2-B2)-(D2-C2))*24

Format column G as a number with two decimals. A day of 8 hours 30 minutes now shows as 8.30 in column F and 8.50 in column G, and both are correct - they are the same length of time wearing two different outfits.

An office desk covered with stacks of paperwork - How to build a time card calculator in Excel
Five formulas turn a blank sheet into a time card that totals itself.

Step 3: the week total and the overtime split

Sum the decimal column for the week: =SUM(G2:G6). Say that lands in cell G9. Overtime in most US setups is whatever passes 40 hours in a single week, so the split is two short formulas. Regular hours, in G10: =MIN(40,G9). Overtime hours, in G11: =MAX(0,G9-40). MIN caps the regular hours at 40 no matter how big the week gets, and MAX keeps the overtime at zero in a short week instead of going negative.

Gross pay follows immediately. Put the hourly rate in a cell of its own, say B12, so you can change it without hunting through formulas. Then pay, in G12, is:

=(G10*B12)+(G11*B12*1.5)

Regular hours at the plain rate, overtime hours at time and a half. That single line is the entire pay calculation for a standard hourly week. Before you trust the sheet with a real week, test it: run the same punches through our time card calculator and compare - the two should agree to the cent.

A worked example, start to finish

Here is a real week run through exactly this sheet, at a rate of $16 an hour with a 30-minute lunch each day:

DayInLunch outLunch inOutDay totalDecimal
Monday8:00 AM12:00 PM12:30 PM5:00 PM8:308.50
Tuesday8:00 AM12:00 PM12:30 PM5:30 PM9:009.00
Wednesday8:00 AM12:00 PM12:30 PM5:00 PM8:308.50
Thursday8:00 AM12:00 PM12:30 PM6:00 PM9:309.50
Friday8:00 AM12:00 PM12:30 PM4:30 PM8:008.00
Week: 43.50 hours - 40 regular + 3.50 overtimeGross pay $724.00

Check the pay line by hand: 40 regular hours x $16 = $640. Overtime is 3.5 hours at $24, which is $84. Total $724, exactly what the formula gives. If your sheet ever disagrees with a hand check like this, the hand check wins the argument - the formula has a wrong cell reference somewhere, and it is almost always a lunch column pointing at the wrong row.

The three errors everyone hits

First, totals that wrap at 24 hours: a week showing 17:30 instead of 41:30 means the [h]:mm format is missing its brackets. Second, the dreaded ###: widen the column, and if it persists, you have a negative time, usually an overnight shift entered as plain times - add 1 to the out time to push it into the next day. Third, times stored as text: if a formula returns 0 or an error for one row only, that row's times were probably typed in a format Excel did not recognize, so they are text pretending to be times. Retype one of them as 8:00 AM and the row usually wakes up.

One more habit worth building in: protect the formula cells (Format Cells, Protection, then Protect Sheet) and leave only the punch columns open. A spreadsheet time card usually dies not from a bad formula but from someone typing a time over a formula in week nine.

Or skip the spreadsheet entirely

A home-built sheet is perfect for checking your own card or running a tiny team's hours. If you would rather not maintain one, our time card calculator does the same job in the browser: same four punches per day, lunch removed automatically, decimal totals, the overtime split and gross pay, plus a printable report and a CSV download if you want the numbers in a file after all. Many people use both - the calculator for the weekly check, and the time calculator on the homepage for quick one-off sums like a single long shift.

Frequently asked questions

Why does my Excel total show 8.5 instead of 8:30?

Because the cell is formatted as a number, not a time. 8.5 is decimal hours, which is payroll's format - but if you want to see 8:30, format the cell as a custom time format [h]:mm. The square brackets matter: they let the total run past 24 hours instead of wrapping back to zero.

Why does my formula show ### in the cell?

Usually the column is simply too narrow, so widen it first. If the cell still shows ### with a time format, the result is probably negative - Excel cannot display negative times. That happens when the out time is earlier than the in time, most often on an overnight shift entered without a date.

How do I handle an overnight shift in Excel?

Add 1 to the out time when it falls after midnight: =(C2+1)-B2 for a simple in and out. The 1 is one full day, which is how Excel stores time internally. Or enter full dates with the times, which handles the rollover automatically.

Can I round punches to the nearest 15 minutes in Excel?

Yes. Wrap the time in MROUND: =MROUND(B2, "0:15") rounds to the nearest quarter hour. For rounding the daily total instead, apply MROUND to the total. MROUND is built into modern Excel and Google Sheets.

Do the same formulas work in Google Sheets?

Yes. Sheets stores times the same way Excel does, as fractions of a day, so the subtraction formulas, the x24 decimal conversion and the [h]:mm format all work unchanged. The overtime MIN and MAX formulas are identical too.

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 29, 2026

Related guides

How to Read Time Card Hours in Decimal Format

Decimal hours stop being confusing once you see where they come from. The conversion, the chart, and the 7.45 trap.

Read the guide

How to Calculate a Biweekly Time Card

Two weeks on one card, but overtime is still counted week by week. Here is how to total both weeks without losing money.

Read the guide

How to Fill Out a Time Card, Step by Step

Every box on the card explained, with a full week filled in correctly and the small mistakes that delay pay.

Read the guide

How to Calculate Overtime on a Time Card

Once your card passes 40 hours, the extra hours pay more. This guide works a full 45-hour week line by line, from punches to gross pay.

Read the guide