How to Calculate Hours and Minutes in Excel (3 Simple Formulas)

Table of Contents

Table of Contents

Calculating hours and minutes in Excel is necessary for managing time-based datasets like employee work hours, event schedules, or project durations. Using various formulas and Excelโ€™s built-in tools, users can easily calculate hours and minutes from their datasets. This guide focuses on showing a single duration as hours and minutes, such as 8:30 or 8h 30m. If you need to add up many shifts into a weekly figure, see how to calculate total hours in Excel.

Key Takeaways

To calculate hours and minutes in Excel, follow the steps below:

โžค Select the columns containing the start and end times. Then right-click the column headers and go to Format Cells >> Time.
โžค Next, select the cell where you want to display the calculated time in hours and minutes, and put the formula:
=End_Time-Start_Time (for example =E2-D2)
โžค Replace End_Time and Start_Time with their cell references – always the later time first.
โžค Lastly, format the column by right-clicking the column header and heading to Format Cells >> Custom >> [h]:mm.

Overview of calculating hours and minutes in Excel from start and end times

In this article, we will learn 3 easy methods of calculating time in hours and minutes in Excel.


1

Calculate Hours and Minutes by Simple Subtraction

This is the simplest and easiest method using which users can quickly calculate time in hours and minutes. We will use a simple formula that subtracts the start time from the end time to calculate the time difference in hours and minutes. This works when both times fall on the same day. If a shift ends after midnight, the end time is smaller than the start time and the result goes negative, which Excel shows as ##### – use the formula in the FAQ below, or see how to calculate hours between two times after midnight.

In the sample dataset, we have a worksheet called โ€œEmployee Work Durationโ€ containing information about Employee name, Department, City, Start time and End Time. Using a simple subtraction formula, we will calculate the time difference in hours and minutes and display it in column F. The updated dataset will be stored in a separate worksheet called โ€œSubtract Formulaโ€.

Steps:

โžค Open the Subtract Formula worksheet, select and right-click column F header to bring out the context menu, then select Format Cells.

Right-click menu on column F header with Format Cells selected

โžค From the Format Cells dialogue box, choose Custom from the category list.
โžค Then, enter [h]:mm in the Type field and click OK to apply the format.

Format Cells Custom category with [h]:mm typed in the Type box

โžค Next, select cell F2 and put the following formula:

=E2-D2

Subtraction formula E2 minus D2 entered in cell F2

โžค Finally, drag the fill handle from cell F2 down to cell F13 to apply the formula across column F.

Fill handle dragged from F2 to F13 to copy the subtraction formula

โžค The calculated duration in hours and minutes should now be visible in column F.

Work duration for each employee shown in hours and minutes in column F


2

Use TEXT Function to Calculate Hours and Minutes

This is another effective method that involves the use of TEXT function to display the calculated time difference in hours and minutes. The TEXT function in Excel is used to convert numbers, dates or time values into text, allowing users to format and display data exactly as they want. Working with the same dataset, we will calculate the time difference and display it in hours and minutes format in column F. The updated data will be shown in a separate worksheet named โ€œTEXT Functionโ€.

Steps:

โžคOpen the TEXT Function worksheet, select cell F2 and put the formula:

=TEXT(E2-D2, "h:mm")

TEXT function formatting the time difference as h:mm in cell F2

Explanation
In the formula, the (E2-D2) part calculates the time difference between End Time (cell E2) and Start Time (cell D2). The ("h:mm") part ensures the result is displayed in hours and minutes format. And finally, the TEXT() part turns the result into text in that format. Your start and end times are untouched, but the cell in column F now holds text rather than a time value, so it cannot be added up - SUM treats text as zero. Use this method for display, and Method 1 for anything you need to total. Also note that "h:mm" resets after 24 hours, so a 26-hour duration shows as 2:00; write "[h]:mm" instead if a duration can pass a full day. To add durations together, see how to add hours, minutes and seconds in Excel.

โžค Next, select cell F2 and drag the fill handle down to F13 to apply the formula across the entire range.

TEXT formula filled down from F2 to F13

โžค Column F should now display the time duration in hours and minutes format.

Time durations displayed as hours and minutes text in column F


3

Use INT and MOD Functions to Separately Calculate Hours and Minutes

This is a more advanced method that uses Excelโ€™s INT and MOD functions to break down time durations into separate hours and minutes components. Unlike other methods, this method gives users more control, allowing for better customization. The INT function in Excel is used to return the integer part of a number, whereas the MOD function returns the remainder after division. We will again work with the same dataset and, using INT and MOD functions, calculate the time difference in column F. We will display the updated dataset in a separate โ€œInt and MOD Functionโ€ worksheet.

Steps:

โžค Open the Int and MOD Function worksheet and in cell F2, put the following formula:

=INT((E2-D2)*24)&”h “&ROUND(MOD((E2-D2)*1440,60),0)&”m”

INT and MOD formula returning hours and minutes as 3h 45m style text

Explanation
In the formula,
โžง (E2-D2) subtracts the Start Time from the End Time, finding the duration in days.
โžง *24 converts the duration from days to hours.
โžง INT() keeps the whole hours and drops the decimal part.
โžง MOD((E2-D2)*1440,60) converts the duration to minutes and returns the remainder after dividing the total minutes by 60.
โžง ROUND(.., 0) rounds the minute value to a whole number, making sure there are no decimal values.
โžง & "h " & .. & "m" combines the hours and minutes values into a readable format like "3h 45m".

โžค Select cell F2, then drag the fill handle down to cell F13 to apply the formula to the rest of the rows.

INT and MOD formula copied down column F with the fill handle

โžค You should now see the time duration in hours and minutes being displayed in column F.

Employee work durations shown as hours and minutes labels in column F

Note: If your times include seconds, the formula above can print 60m – for example 09:00:00 to 11:59:40 shows 2h 60m instead of 3h 0m, because the minutes are rounded after the hours are split off. Round the total minutes first to avoid it:

=INT(ROUND((E2-D2)*1440,0)/60)&"h "&MOD(ROUND((E2-D2)*1440,0),60)&"m"

To put hours and minutes in separate cells instead of one text string, use =INT(ROUND((E2-D2)*1440,0)/60) for the hours and =MOD(ROUND((E2-D2)*1440,0),60) for the minutes. Both return numbers you can add up. If you only need the total in minutes, see how to calculate time difference in minutes.


Downloadable Resources

Get our practice workbook or necessary files that we have worked with to prepare this article.

Calculate Hours and Minutes.xlsx


Frequently Asked Questions

Why is My Time Calculation Showing Negative Values or Errors?

Your calculated time may show an error or negative values if the End time is earlier than the Start time ( End time < Start Time). To avoid this issue, you can use the following formula:
=IF(E2<D2, E2+1-D2, E2-D2)
This condition assumes that the End time is on the next day and adjusts the calculation accordingly to avoid any negative value.

What is the Best Method for Working With Large Datasets?

If you are working with a large dataset, the simple subtraction method would be the most efficient because of its speed and simplicity. However, if you need more control over the calculation and want to display custom formats, the INT and MOD function method would be the ideal choice.


Concluding Words

Knowing how to calculate hours and minutes in Excel is essential for accurate time tracking in datasets. In this article, we have discussed 3 effective methods of calculating hours and minutes in Excel, including simple subtraction, using the TEXT function and combining INT and MOD functions. Feel free to try all these methods and choose the one best suited for your needs. If the hours feed a pay run, see how to calculate hours and minutes for payroll.

Facebook
X
LinkedIn
WhatsApp
Picture of Mashrur Ibne Shams

Mashrur Ibne Shams

Mashrur Ibne Shams holds a BSc in Industrial and Production Engineering and is a Certified Supply Chain Analyst (CSCA). With 3 years of Excel and Google Sheets experience, he specializes in data cleaning, text extraction, advanced formulas, dynamic arrays, VBA automation, and Power Query. He has created step-by-step tutorials and custom VBA scripts for real-world datasets. He enjoys simplifying complex tasks, automating processes, and organizing data efficiently.
We will be happy to hear your thoughts

      Leave a reply


      Excel Insider
      Logo