How to Formulate a Timesheet in Excel: Step-by-Step
In this article
To formulate a timesheet in Excel, you need three things: a column for clock-in and clock-out times, a formula that calculates the hours worked each day, and a formula that adds those daily totals into a weekly figure. The quickest working version uses =MOD(ClockOut-ClockIn,1) for each day and =SUM() across the daily totals, formatted as [h]:mm so hours over 24 don't roll over to zero. The steps below build that sheet from a blank workbook, add overtime handling, and cover the mistakes that make totals come out wrong.
What You'll Need
- Excel on desktop (Windows or Mac) or Excel for the web. The formulas here work in all of them; the exact location of some ribbon buttons varies slightly by version and platform.
- A blank workbook and about ten minutes.
- Your pay period rules: which day the week starts on, when overtime begins, and whether breaks are unpaid.
- Optional: a list of employees if you are building a multi-person sheet.
Step-by-Step
- Set up the header row. In row 1, type these labels across columns A to G: Date, Day, Clock In, Clock Out, Break (mins), Hours Worked, Notes. Bold the row and add a fill colour so it reads as a header. Freeze it with View > Freeze Panes > Freeze Top Row so it stays visible as you scroll.
- Enter the dates for one week. Type the first date in A2, then drag the fill handle down to A8 to create seven consecutive dates. In B2 enter =A2 and format that cell as a custom date of ddd so it shows Mon, Tue and so on. Copy B2 down to B8.
- Format the time columns. Select C2:D8 and apply a time format such as h:mm AM/PM (right-click > Format Cells > Time). This matters: if the cells are left as General, Excel may read 9:00 as text and every formula will fail.
- Enter times as real times. Type clock-in and clock-out values like 9:00 AM and 5:30 PM. Always include AM or PM, or use 24-hour format. Typing just 5:30 is read as 5:30 AM, which produces a negative or wildly wrong total.
- Build the hours formula. In F2 enter =MOD(D2-C2,1)*24-E2/60. This subtracts clock-in from clock-out, wraps correctly when a shift crosses midnight, converts the Excel day fraction to decimal hours, and takes off the break minutes. Copy F2 down to F8. Format F2:F8 as a number with two decimals.
- Total the week. In F9 enter =SUM(F2:F8). Label A9 as Total hours. If you prefer to see the total as a time rather than a decimal, use =SUM(F2:F8)/24 and format that cell as [h]:mm — the square brackets stop the count resetting at 24 hours.
- Add overtime. Put your weekly threshold in a labelled cell, for example H1 with the label OT after in G1 and the value 40 in H1. In F10 enter =MAX(0,F9-H1) for overtime hours and in F11 enter =MIN(F9,H1) for regular hours. Both recalculate automatically when you change a time.
- Add data validation to prevent typos. Select C2:D8, go to Data > Data Validation, choose Time as the allowance, and set reasonable bounds such as 12:00 AM to 11:59 PM. This blocks text entries that would break the formulas.
- Copy the sheet for each week. Right-click the sheet tab, choose Move or Copy, tick Create a copy, and rename it for the next week. Change the dates in column A; the formulas carry over.
- Save a template. Use File > Save As and choose Excel Template (.xltx) so each new pay period starts from a clean, formula-ready sheet.
Common Mistakes
- Typing times as text. If a time cell is left-aligned, Excel stored it as text. Re-enter it with AM/PM or reformat the cell as Time first.
- Forgetting the MOD wrapper. A plain =D2-C2 returns a negative number for night shifts that cross midnight. MOD fixes the wrap.
- Mixing decimal hours and time values. Multiplying by 24 gives decimal hours (8.5); leaving it out gives a fraction of a day (0.354). Pick one and format consistently.
- Using h:mm instead of [h]:mm for totals. A 45-hour week displays as 21:00 because the clock resets at 24. The brackets prevent this.
- Leaving break cells blank. A blank break cell is treated as zero, which is usually fine, but a cell containing a space or a dash breaks the subtraction. Enter 0 instead.
- Hard-coding totals. Typing the weekly total instead of using SUM means the figure never updates when a time is corrected.
Tips
- Colour weekend rows with conditional formatting (Home > Conditional Formatting > New Rule) so they stand out.
- Round to the nearest quarter hour with =MROUND(F2,0.25) if your payroll works in 15-minute blocks.
- Protect the formula cells: select them, then Review > Protect Sheet and lock only the cells you don't want edited. Note what you are locking before you apply it, because a protected sheet blocks all edits unless you allow them.
- Keep one sheet per pay period rather than one giant running list; it is easier to check and archive.
- If you manage several people, add an Employee column and use Data > Sort or a pivot table to total per person.
Troubleshooting
- Hours show as ######: the column is too narrow. Widen it, or check the cell is formatted as a number rather than a date.
- A total shows a negative time: a clock-out is earlier than a clock-in without a MOD formula, or a break value exceeds the shift length. Check both cells.
- The total is a tiny decimal like 0.35: the cell is showing a fraction of a day. Multiply by 24 or apply the [h]:mm format.
- A formula returns #VALUE!: one of the time cells contains text. Re-enter it as a time and confirm the cell format.
- Totals don't update: calculation may be set to Manual. Go to Formulas > Calculation Options and choose Automatic.
- If that did not work, rebuild one row from scratch in a fresh sheet using the exact formulas above. If the single row calculates correctly, copy that row's formulas down rather than retyping them.
Frequently Asked Questions
Why does my total show 21:00 for a 45-hour week?
The cell is formatted as h:mm, which resets at 24 hours. Change the format to [h]:mm and the full 45:00 appears.
How do I handle a shift that crosses midnight?
Use =MOD(ClockOut-ClockIn,1). It treats the end time as the next day automatically, so 10:00 PM to 6:00 AM returns 8 hours.
Can I use the same sheet for several employees?
Yes. Add an Employee column and either sort by it or build a pivot table with Employee in Rows and Hours in Values to total each person.
Should I track hours in decimal or as time?
Decimal is easier for payroll maths (8.5 hours); time format is easier to read. You can keep both by storing time and adding a decimal column that multiplies by 24.
Does this work in Excel for the web and Google Sheets?
The formulas are the same. Menu names differ slightly between Excel versions, platforms and Google Sheets, but MOD, SUM, MAX and MIN behave identically.
How do I stop people editing the formulas?
Select the input cells, unlock them in Format Cells > Protection, then apply Review > Protect Sheet. Locked formula cells can then be viewed but not changed.