To subtract hours and minutes in Excel, use a simple subtraction formula: =End_Time - Start_Time. Because Excel treats time as a fraction of a 24-hour day, this basic formula calculates the difference between two time values provided they are entered in a recognized time format (such as HH:MM AM/PM or 24-hour format). If the result appears as a decimal or a strange time, you must change the cell format to Time or a custom duration format to see the result in hours and minutes.

What You'll Need

  • Microsoft Excel (any modern version, including Excel 365, Excel 2021, or Excel for the Web).
  • A dataset containing start times and end times entered in a valid time format.
  • Basic knowledge of how to enter a formula into a cell.

Step-by-Step

  1. Enter Your Time Data: Input your start and end times into two separate columns. For example, enter the start time in cell A2 (e.g., 8:00 AM) and the end time in cell B2 (e.g., 5:30 PM). Ensure you include a space before the AM or PM, or use 24-hour military time (e.g., 17:30) to ensure Excel recognizes the entry as a time value rather than text.
  2. Insert the Subtraction Formula: Click on the cell where you want the duration to appear (e.g., cell C2). Type the equals sign =, click on the end time cell (B2), type the minus sign -, and then click on the start time cell (A2). Your final formula should look like =B2-A2. Press Enter.
  3. Adjust the Cell Format: If the result looks like a decimal (e.g., 0.354) or a time of day (e.g., 9:30 AM) instead of a duration, you need to format the cell. Right-click the result cell and select Format Cells from the menu.
  4. Select the Time Category: In the Format Cells dialog box, go to the Number tab and select Time from the Category list on the left. Choose the format that looks like 13:30 or 37:30:55 depending on whether your total will exceed 24 hours.
  5. Apply Custom Formatting for Durations: If you want the result to explicitly show hours and minutes without looking like a time of day, select Custom in the Category list. In the Type field, manually type [h]:mm. The square brackets around the 'h' are critical; they tell Excel to accumulate hours beyond 24 rather than resetting to zero at midnight.
  6. Drag the Formula Down: To apply this calculation to an entire list of times, hover your mouse over the bottom-right corner of the result cell (C2) until the cursor turns into a small black cross (the fill handle). Click and drag the handle down to the bottom of your data range.

Common Mistakes

The most frequent error when subtracting time in Excel is entering times as text. If you type "8am" instead of "8:00 AM", Excel treats the entry as a string of characters rather than a numerical value. When you try to subtract text, Excel will return a #VALUE! error. Always use a colon to separate hours and minutes and ensure there is a space before the AM/PM indicator.

Another common mistake is forgetting that Excel resets time every 24 hours. If you subtract 8:00 AM from 10:00 PM, you get 14 hours. However, if you are calculating a shift that starts at 10:00 PM and ends at 6:00 AM the next day, a simple =B2-A2 formula will result in a negative number. Since Excel cannot display negative time by default, it will fill the cell with a series of hashtags (#######).

Users also often confuse the h:mm format with the [h]:mm format. The former is for time-of-day (clock time), while the latter is for elapsed time (duration). If your total hours add up to 25, h:mm will display as 1:00 (because it removes the full 24-hour cycle), whereas [h]:mm will correctly display as 25:00.

Tips

To handle shifts that cross over midnight, use the MOD function. Instead of =B2-A2, use the formula =MOD(B2-A2, 1). The MOD function returns the remainder after division. By dividing the time difference by 1, Excel effectively adds 24 hours to any negative result, correcting the midnight crossover automatically without needing to enter dates.

If you need to convert the resulting time into a decimal number (for example, to multiply hours worked by an hourly pay rate), you must multiply the result by 24. This is because Excel stores 1 hour as 1/24 of a day. For example, if cell C2 contains 08:30 (8.5 hours), the formula =C2*24 will give you 8.5. Make sure to change the format of this final result cell to Number or General, otherwise Excel may try to format the result as a time again.

For high-precision tracking, use the TEXT function to create a readable string. If you want a cell to say "Total Time: 8 hours 30 mins", use the formula: ="Total Time: " & TEXT(B2-A2, "[h] \"hours\" m \"mins\""). This combines a text label with a formatted time value.

Troubleshooting

If your formula returns a #VALUE! error, the most likely cause is that one of your time entries is formatted as text. To fix this, select the column of times, go to the Data tab, select Text to Columns, and simply click Finish. This often forces Excel to re-evaluate the cells and convert text-based times into actual time values.

If you see a string of hashtags (#######) in your result cell, it usually means the result is a negative time value (which happens when the start time is later than the end time) or the column is too narrow to display the result. First, try widening the column. If the hashtags remain, check if your time range crosses midnight. If it does, apply the =MOD(B2-A2, 1) formula mentioned in the Tips section.

If the result is a decimal like 0.375 instead of 9:00, your cell is set to the General or Number format. To fix this, right-click the cell, select Format Cells, and choose Time. If the hours are incorrect (e.g., it shows 1 hour instead of 25), switch to the Custom category and use the [h]:mm format.

Frequently Asked Questions

How do I subtract minutes from a specific time?

To subtract a specific number of minutes (e.g., 15 minutes) from a time in cell A1, use the formula =A1 - TIME(0, 15, 0). The TIME function follows the format TIME(hours, minutes, seconds).

Can I subtract time across different dates?

Yes. The most accurate way is to enter both the date and the time in the cell (e.g., "2023-12-01 22:00"). When you subtract the start date/time from the end date/time, Excel calculates the total elapsed time including the days. Use the [h]:mm format to see the total hours.

Why does my time subtraction result in a decimal?

Excel stores time as a fraction of a 24-hour day. For example, 12:00 PM is stored as 0.5. If your cell is formatted as "General", you see the underlying decimal. Change the cell format to "Time" to see it in hours and minutes.

How do I sum multiple time subtractions?

Use the =SUM() function on your range of calculated durations. However, the total cell must be formatted as [h]:mm. If you use the standard Time format, the total will reset to zero every time it hits 24 hours.

Is there a way to subtract time without using formulas?

No, subtraction of time values requires a formula. While you can use the AutoSum feature for addition, subtraction must be performed using the minus operator (-) or a function like MOD for complex time spans.