To track time in Excel, the most effective method is to subtract the start time from the end time using the formula =(End_Time - Start_Time) and then formatting the result cell as [h]:mm. This allows you to calculate the duration between two specific points in time, whether for employee timesheets, project tracking, or personal productivity logs. Because Excel treats one full day as a value of 1, time is stored as a decimal fraction of a day, which is why specific cell formatting is required to see the result in hours and minutes rather than a decimal.

What You'll Need

  • A computer with Microsoft Excel installed (works across Windows, macOS, and Web versions).
  • A dataset consisting of start times and end times.
  • Basic knowledge of how to select cells and enter formulas.

Step-by-Step

  1. Set Up Your Columns: Create a table with clear headers. In cell A1, type "Date". In cell B1, type "Start Time". In cell C1, type "End Time". In cell D1, type "Total Hours". This structure ensures your data remains organized and easy to reference in your formulas.
  2. Enter Your Time Data: Input your times in columns B and C. For the best results, use a consistent format such as 8:00 AM or 17:00 (24-hour format). Excel is generally flexible with time entry, but consistency prevents errors during calculation. For example, in cell B2, enter 08:30 AM and in cell C2, enter 05:00 PM.
  3. Apply the Basic Subtraction Formula: Click on cell D2 (the Total Hours column). Type the equals sign = to start the formula, then click cell C2 (End Time), type a minus sign -, and click cell B2 (Start Time). Your final formula should look like this: =C2-B2. Press Enter.
  4. Format the Result Cell: Initially, Excel might display the result as a decimal or a time of day (e.g., 8:30 AM). To fix this, right-click cell D2 and select "Format Cells..." (or press Ctrl+1 on Windows / Cmd+1 on Mac). In the "Category" list on the left, select "Custom". In the "Type" field, manually type [h]:mm. The square brackets around the 'h' are critical; they tell Excel to accumulate hours beyond 24, which is essential if you are totaling time for a whole week.
  5. Handle Overnight Shifts: If a shift starts at 10:00 PM and ends at 6:00 AM the next day, the basic subtraction formula will result in a negative number (displayed as a string of hashtags #######). To solve this, use the MOD function. Change your formula in cell D2 to: =MOD(C2-B2, 1). The MOD function with a divisor of 1 ensures that if the result is negative, Excel adds 1 (representing 24 hours) to the value, correctly calculating the overnight duration.
  6. Calculate Total Time for Multiple Days: Once you have the daily totals in column D, go to the bottom of that column (e.g., cell D10) and use the SUM function: =SUM(D2:D9). Again, ensure this total cell is formatted as [h]:mm. If you use the standard "h:mm" format, a total of 25 hours will appear as "1:00" because Excel resets the clock every 24 hours.
  7. Convert Time to Decimal for Payroll: If you need to multiply the tracked time by an hourly rate (e.g., $20/hour), you cannot multiply the [h]:mm value directly because Excel sees it as a fraction of a day. To convert time to a decimal number, multiply the time result by 24. In cell E2, enter: =(D2*24). Then, change the cell format of E2 to "Number" or "General". For example, 8 hours and 30 minutes will now appear as 8.5.

Common Mistakes

The most frequent error is forgetting the square brackets in the custom format [h]:mm. Without them, any total exceeding 24 hours will "wrap around" and start over from zero. For instance, if a project took 26 hours, Excel will display 2:00 instead of 26:00. This leads to massive undercounting in payroll or project reports.

Another common mistake is mixing date and time formats inconsistently. If you enter some times as "8am" and others as "08:00", Excel usually handles it, but if you accidentally enter a time as text (e.g., "8 o'clock"), the subtraction formula will return a #VALUE! error because you cannot perform math on a text string.

Users also often forget that Excel treats time as a fraction of 1. Many attempt to multiply a time cell (like 08:00) by a dollar amount (like $20) and get a result of $6.67 instead of $160. This happens because Excel is multiplying 0.333 (the decimal value of 8 hours) by 20. You must always multiply by 24 first to get the decimal hour value.

Tips

To speed up data entry, use the keyboard shortcut Ctrl + Shift + : (colon) to instantly insert the current system time into a cell. This is perfect for "punching in" and "punching out" in real-time.

If you are tracking time across multiple days and don't want to use the MOD function, you can include the date in the cell. Instead of just entering 8:00 AM, enter 2026-12-04 8:00 AM. When you subtract a start date-time from an end date-time, Excel automatically calculates the total elapsed time, including days, removing the need for complex overnight formulas.

Use Conditional Formatting to highlight overtime. You can set a rule that turns a cell red if the value in the "Total Hours" column is greater than 8:00 (or =D2 > TIME(8,0,0)), allowing you to spot long shifts at a glance.

Troubleshooting

If you see ####### in your cell: This usually means one of two things. First, the column is too narrow to display the result; try widening the column. Second, the formula has resulted in a negative time value (which happens when the end time is earlier than the start time, such as in overnight shifts). If widening the column doesn't work, apply the =MOD(C2-B2, 1) formula described in the step-by-step section.

If the formula returns #VALUE!: Check your data entry. Ensure there are no accidental spaces before or after the time and that you haven't used letters or words within the time cell. A quick way to check if Excel recognizes a cell as time is to look at the alignment; by default, numbers and times align to the right, while text aligns to the left.

If the total hours seem too low: Check the cell formatting. Right-click the cell, go to "Format Cells", and ensure you are using [h]:mm and not h:mm. The square brackets are the only way to display cumulative hours beyond a single day.

Frequently Asked Questions

How do I subtract time if the shift crosses midnight?

Use the formula =MOD(End_Time - Start_Time, 1). This tells Excel to treat the result as a positive duration even if the end time is numerically smaller than the start time.

Why does my total time reset after 24 hours?

This is due to the default time format. To fix it, go to Format Cells > Custom and change the format to [h]:mm. The brackets prevent the hour count from resetting at 24.

Can I track time in minutes only?

Yes. Use the formula =(End_Time - Start_Time) * 1440. Since there are 1,440 minutes in a day, this converts the Excel time fraction into total minutes. Format the result cell as "Number".

How do I calculate pay based on tracked time?

Multiply the total time by 24 to get a decimal, then multiply by the hourly rate. Example: =(Total_Time * 24) * Hourly_Rate.

Is there a way to automatically log the time when I change a cell?

Standard formulas like =NOW() update every time the sheet recalculates. To create a permanent timestamp, you must use a VBA macro or the keyboard shortcut Ctrl + Shift + :.