Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Work Out Hours Worked in Excel

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Calculating hours worked in Excel is essential for payroll, time tracking, and project management. Excel can accurately compute time differences between clock-in and clock-out times, even across midnight, as long as the data is entered correctly and formatted as time. No special add-ins or plugins are required—this works with standard Excel functions on any version from 2010 onward.

What You'll Need

  • A spreadsheet with start and end times entered in separate columns
  • Excel installed (any version from 2010 or later)
  • Basic understanding of entering time values (e.g., 9:00 AM, 17:30)

Step-by-Step

  1. Open a new or existing Excel worksheet and label two columns as "Start Time" and "End Time" in cells A1 and B1.
  2. In column C, label a third cell as "Hours Worked" to display the calculated result.
  3. Enter the start time in column A (e.g., A2: 9:00 AM) and the end time in column B (e.g., B2: 5:30 PM). Use the 12-hour format with AM/PM, or 24-hour format (e.g., 17:30) — Excel accepts both.
  4. In cell C2, type the formula: =B2-A2 and press Enter. This subtracts the start time from the end time to get the duration.
  5. Right-click cell C2, select "Format Cells", then choose "Number" from the category list. Under "Type", select "h:mm" to display hours and minutes (e.g., 8:30 for 8 hours and 30 minutes).
  6. If the work period crosses midnight (e.g., starts at 10:00 PM and ends at 6:00 AM), Excel will show a negative result. To fix this, modify the formula to: =IF(B2. This adds one full day (1) when the end time is earlier than the start time, correcting the calculation.
  7. Drag the fill handle (small square at the bottom-right corner of cell C2) down to copy the formula to other rows for multiple entries.
  8. To total all hours worked, use =SUM(C2:C10) in a new cell below your data range. Format that cell as "h:mm" or "[h]:mm" to display total hours beyond 24 (e.g., 45:30 for 45 hours and 30 minutes).

Common Mistakes

  • Entering times as text (e.g., "8 hours 30 minutes") instead of actual time values — Excel won’t calculate them.
  • Forgetting to format the result cell as time, which may display the result as a decimal (e.g., 0.354 instead of 8:30).
  • Not accounting for overnight shifts, causing negative values that appear as errors or #####.
  • Using 12-hour format without AM/PM, which Excel may misinterpret as 00:00 (midnight).
  • Assuming the formula =B2-A2 works for all cases — it fails if end time is before start time without the IF correction.

Tips

  • Use the time format "[h]:mm" for totals to avoid Excel resetting hours after 24 — for example, 27:15 instead of 3:15.
  • Enter times using the colon separator (e.g., 9:30) — avoid typing "9 hour 30 min" or using spaces.
  • Use data validation (Data > Data Validation > Time) to restrict entries to valid time formats and prevent typos.
  • For breaks, subtract a fixed amount (e.g., 0:30 for 30 minutes) using a formula like =IF(B2 (0.020833 = 30 minutes as a decimal fraction of a day).
  • Use conditional formatting to highlight entries over 8 hours for overtime review.

Troubleshooting

  • If you see ##### in the cell, widen the column width — the time value is too wide for the cell.
  • If the formula returns a negative number or 0, check that start and end times are entered correctly and that the end time is later than the start time unless you're using the overnight correction formula.
  • If the result shows as a decimal (e.g., 0.354), reformat the cell to "h:mm" or "[h]:mm" via Format Cells > Number > Custom.
  • If Excel says "There's a problem with this formula", verify you’re using English function names (e.g., "IF" not "SI") and that your regional settings aren’t altering syntax — switch to English if needed.
  • If times are being interpreted incorrectly (e.g., 9:30 becomes 9:30 PM), ensure AM/PM is included or use 24-hour format consistently.

Frequently Asked Questions

Can Excel calculate hours worked across multiple days?

Yes, by using the formula =IF(B2 for each shift. For multi-day totals, sum the individual results using SUM and format the total cell as "[h]:mm" to show total hours beyond 24.

Why does Excel show 0.375 instead of 9:00?

Excel stores time as fractions of a day (1 day = 1). 0.375 equals 9 hours (9/24). Change the cell format to "h:mm" to display it correctly.

Can I calculate hours without entering dates?

Yes, as long as you use the overnight correction formula. Excel treats time values independently of dates. The system assumes start and end times are on the same day unless the end time is earlier than the start time, which triggers the correction.

What if someone works two shifts in one day?

Add separate start/end pairs (e.g., Shift 1: A2-B2, Shift 2: A3-B3), calculate each, then sum them with =SUM(C2,C3). Do not combine start and end times into single cells.

Can I include unpaid breaks automatically?

Yes. If breaks are always 30 minutes, subtract 0:30 from each shift using =IF(B2. For variable breaks, add a separate "Break Duration" column and subtract it from the total.

Does this work on Excel for Mac or mobile?

Yes, all standard time calculation functions work identically on Excel for Mac, Windows, iOS, and Android. The user interface may differ slightly, but formulas and formatting options are consistent.