If you have two times in two different cells in Excel and want to **calculate the difference** in hours, then you are in the right place. We will show you 6 different methods that you can use to calculate hours between two times in Excel.

**Table of Contents**hide

## Download the Practice Workbook

Download the Excel file and practice along with it.

## 6 Methods to Calculate Hours Between Two Times in Excel

Weâ€™ve created the following data table to calculate the hours between two times in Excel. The table consists of 3 columns. The first column contains the starting time, the second column contains the ending time and the third column contains** total hours.** Now, letâ€™s have a sneak peek of our dataset:

So, without having any further discussion letâ€™s dive straight into all the methods one by one.

### 1. Calculate Hours Simply by Subtracting Two times in Excel

The most basic way of **calculating time in hours** between two times is to subtract those two times. But we need to ensure one thing that is we have to subtract the starting time from the end time. Otherwise, the result will be negative.

To do that, follow the steps below.

**đź”— Steps:**

âť¶ Type the following subtraction formula within cell **D5**.

`=C5-B5`

âť· After that press the **ENTER** button.

âť¸ Lastly, finish the whole process by dragging the **Fill Handle** icon to the end of the Total Hours column.

**Read More: How to Subtract and Display Negative Time in Excel (3 Methods)**

### 2. Use HOUR Function to Compute Hours Between Two Times in Excel

In the following data table, we have the starting time in the first column and ending time in the second column. Now we will calculate the differences between the starting time and the ending time of a session using the **HOUR** function.

We will store the output of the **HOUR** function in the third column of the data table whose header is total hours.

Now follow the steps below.

**đź”— Steps:**

âť¶ You have to select cell **D5** to insert the following formula:

`=HOUR(C5-B5)`

âť· After inserting the formula, you have to press the **ENTER** button to get the result of the **HOUR** function.

âť¸ Lastly, drag the **Fill Handle** icon to the end of the Total Hours column.

**Read More:** **Excel formula to calculate hours worked & overtime [with template]**

### 3. Use TEXT Function to Calculate Hours Between Two Times in Excel

You can use the **TEXT** function instead of using the **HOUR** function to directly calculate the hours between two times.

For that purpose, you can follow the steps below.

**đź”— Steps:**

âť¶ Type the following formula on cell **D5**.

`=TEXT(C5-B5, "h")`

âť· Now hit the **ENTER** button to execute the formula.

âť¸ Finally, drag the **Fill Handle** icon to the end of the Total Hours column.

This formula can return the hours between two times directly as in the picture below:

**Read More:** **How to Calculate Total Hours Worked in a Week in Excel (Top 5 Methods)**

**Similar Reading**

**[Fixed!] SUM Not Working with Time Values in Excel (5 Solutions)****Add Minutes to Time in Excel (5 Easy Ways)****How to Calculate the Duration of Time in Excel (7 Methods)****How to Calculate Total Hours in Excel (9 Easy Methods)**

### 4. Calculate Hours Between Two Different Dates in Excel

Suppose, you want to compute the difference between two times of two different dates in hours. Excel will allow you to do so simply by subtracting two cells and using the **INT** function to trim the trailing numbers after the decimal point.

Now, follow the steps below.

**đź”— Steps:**

âť¶ Insert the formula below within cell **D5**.

`=INT((C5-B5)*24)`

âť· Now hit the **ENTER** button and pull the **Fill Handle** icon to the end of the third column of the data table.

đź’ˇ **Note:** The number format of the column where you typed the formula, has to be **General**.

**Read More: ****How to Calculate Hours and Minutes for Payroll Excel (7 Easy Ways)**

### 5. Use IF Function to Calculate Hours Between Two Times in Excel

We can count the difference between two times in hours using logic with the **IF** function.

As to** calculate time** with a positive value, we need to subtract the start time from the end time, we will first compare the two times to meet this criterion. Anyways, follow the steps below:

**đź”— Steps:**

âť¶ Insert the formula below on cell **D5**.

`=IF(C5>B5,C5-B5,1-B5+C5)`

âť· Then press the **ENTER** button and drag the **Fill Handle** icon to the end of the Total Hours column.

**Read More: Excel Calculate Hours between Two Times after Midnight (3 Methods)**

### 6. Count Elapsed Time in Hours from a Starting Time to Now

We can count the total elapsed time in hours from a certain starting time period. In this regard, we can get the current time easily with the help of the **NOW** function.

In the standard time format, it consists of three parts which are hour, minute, and second. To retrieve these, we will use the **HOUR**, **MINUTE**, and **SECOND** functions respectively.

On top of that, we have to use the **TIME** function to constitute the standard time format with hours, minutes, and seconds.

To do that, follow the steps below.

**đź”— Steps:**

âť¶ Enter the following formula within cell **D5**.

`=TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW())) -B5`

âť· After that press the **ENTER** button.

âť¸ Finally drag the **Fill Handle** icon to the end of the Total Hours column.

**Formula Breakdown:**

**HOUR(NOW()**â–¶ returns the current hour of time.**MINUTE(NOW()**â–¶ returns present minute.**SECOND(NOW()**â–¶ returns the current second of time.**TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))**â–¶ constitutes standard time formula of the current time.

**Read More: How to Calculate Hours and Minutes in Excel (7 Handy Ways)**

## Things to Remember

đź“Ś If a cell doesnâ€™t have enough space to show the entire time value, then Excel returns **####** error.

đź“Ś Adjust the cell width to fix the** ####** issue.

## Conclusion

To sum up, we have discussed 6 methods to calculate hours between two times in Excel. You are recommended to download the practice workbook attached along with this article and practice all the methods with that. And donâ€™t hesitate to ask any questions in the comment section below. We will try to respond to all the relevant queries asap. And please visit our website **Exceldemy** to explore more.

**Related Articles**

**Formula for Overtime over 40 Hours [with Free Template]****Excel Formula to Calculate Hours Worked Minus Lunch****How to Add Hours to Time in Excel (8 Quick Ways)****How to Calculate Average Response Time in Excel (4 Methods)****Excel Formula for Overtime over 8 Hours (4 Examples)****How to Calculate Average Handling Time in Excel (2 Easy Ways)****Timesheet Formula in Excel (5 Examples)****How to Sum Time in Excel (9 Suitable Methods)**