To work with time in Excel, enter your data using a colon (e.g., 8:30 AM or 14:00) and ensure the cell is formatted as "Time." Because Excel treats time as a fraction of a 24-hour day, calculating durations requires specific formatting—specifically the square bracket format [h]:mm—to prevent totals from resetting to zero after 24 hours.

What You'll Need

  • A computer with Microsoft Excel installed (Windows, macOS, or Web version).
  • A dataset of start and end times or durations you wish to track.

Step-by-Step

  1. Enter Time Data: Click on a cell and type the time. Use a colon to separate hours, minutes, and seconds. For example, type 9:00 AM or 17:30. Excel usually recognizes these patterns and automatically assigns the Time format. (Note: Menu labels may vary slightly depending on your version or region).
  2. Apply Time Formatting: If your time looks like a decimal (e.g., 0.375 instead of 9:00 AM), select the cell, go to the Home tab, and in the Number group, click the dropdown menu and select Time.
  3. Calculate Time Difference: To find the duration between two times (e.g., a shift from 8:00 AM to 5:00 PM), use a simple subtraction formula. If the start time is in cell A2 and the end time is in cell B2, click cell C2 and type =B2-A2, then press Enter.
  4. Handle Overnight Shifts: If a shift starts on one day and ends the next (e.g., 10:00 PM to 6:00 AM), a simple subtraction will result in a negative number or a series of hash marks (#####). To fix this, use the formula =B2-A2+(A2>B2). This adds 1 (representing one full day) if the start time is greater than the end time.
  5. Sum Total Hours: To add multiple time durations together, use the =SUM() function. For example, =SUM(C2:C10).
  6. Format Totals Over 24 Hours: By default, Excel resets the clock every 24 hours. If your total is 25 hours, Excel will display it as 1:00. To show the true total:
    • Right-click the total cell and select Format Cells...
    • In the Category list, select Custom.
    • In the Type box, manually type [h]:mm. The square brackets tell Excel to accumulate hours rather than wrap them into days.
  7. Convert Time to Decimals: If you need to multiply hours by a hourly rate (e.g., 8 hours 30 minutes * $20/hr), you must convert the time to a decimal first. Multiply the time result by 24. For example: =(B2-A2)*24. Format this result cell as Number or Currency.

Common Mistakes

  • Entering time as text: Typing "8 hours" instead of "8:00" makes the cell a text string, meaning Excel cannot perform math on it. Always use the colon format.
  • Ignoring the 24-hour wrap: Forgetting to use the [h]:mm format for totals is the most common cause of "incorrect" sums in timesheets.
  • Mixing AM/PM incorrectly: If you use a 12-hour clock, always include the AM or PM. If you omit it, Excel defaults to AM for morning hours and may misinterpret afternoon entries.
  • Directly multiplying time by money: Multiplying 8:30 by 20 will result in a wrong number because Excel sees 8:30 as 0.354 of a day. You must multiply by 24 first.

Tips

  • Keyboard Shortcut: Press Ctrl + Shift + : (colon) to instantly insert the current system time into a selected cell.
  • Consistency: Stick to either 24-hour military time (14:00) or 12-hour time (2:00 PM) throughout your sheet to avoid entry errors.
  • Custom Formatting: In the Custom Format menu, use hh:mm:ss if you need to track precise seconds for athletic timing or scientific data.

Troubleshooting

If your time calculations are not working as expected, try these steps in order:

  1. Check for Hash Marks (#####): If a cell shows #####, it usually means the result is a negative time (which Excel cannot display) or the column is too narrow. Widen the column first; if that fails, check if your end time is earlier than your start time.
  2. Verify Cell Format: Ensure the cells are not formatted as "Text." Select the cell, look at the Number dropdown on the Home tab, and change it to "Time" or "General" to see if the value changes.
  3. Clear Formatting: If a cell is behaving strangely, go to the Home tab, click Clear (the eraser icon), and select Clear Formats, then re-apply the Time format.
  4. Check for Hidden Spaces: If you imported data from another software, there may be leading or trailing spaces. Use the =TRIM() function to remove them.

Frequently Asked Questions

Why does my total time reset to 0 after 24 hours?

Excel's default time format treats 24 hours as one full day and starts over at zero. To fix this, use the Custom format [h]:mm.

How do I subtract time across different dates?

The easiest way is to enter both the date and the time in the cell (e.g., 2026-12-05 08:00). When you subtract the start cell from the end cell, Excel will calculate the total elapsed time including the days.

Can I use the TIME function to create a value?

Yes. The formula =TIME(hour, minute, second) allows you to build a time value using numbers from other cells. For example, =TIME(A1, B1, 0) will combine hours from A1 and minutes from B1.

How do I calculate the difference between two times in minutes?

Subtract the start time from the end time, then multiply the result by 1440 (the number of minutes in a day). Format the resulting cell as a Number.

What is the difference between "Time" and "Custom" formats?

The "Time" format provides standard presets (like 1:30 PM). The "Custom" format allows you to create specific displays, such as [h]:mm for durations or hh:mm AM/PM for specific aesthetics.