Excel Formulas to Calculate the Number of Hours between Two Times!!
Tags: excelformula, excelformulas
Published: 2021-05-03 09:25:48

---
title: Excel Formulas to Calculate the Number of Hours between Two Times!!
published: true
date: 2021-05-01 06:50:55 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-calculate-the-number-of-hours-between-two-times/
---

Calculating the duration between two times can be a little tricky depending on the number of minutes and seconds in the two times being compared. So here, we will show the simple formula to **calculate the number of hours between two times in Excel**. Let’s get into this article!! Get an official version of ** MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

[![Calculate Number of hours](https://geekexcel.com/wp-content/uploads/2021/05/Calculate-Number-of-hours.png)](https://geekexcel.com/excel-formulas-to-calculate-the-number-of-hours-between-two-times/calculate-number-of-hours/#main)<figcaption id="caption-attachment-34923">Calculate the Number of hours</figcaption>

## General Formula:

- If you want to calculate the number of hours between two times, you can use the below formula.

**=[IF](https://geekexcel.com/use-if-function-in-microsoft-excel-365-simple-steps/)(end>start, end-start, 1-start+end)**

## Syntax Explanations:

- **IF**  – In Excel, the **[IF Function](https://geekexcel.com/use-if-function-in-microsoft-excel-365-simple-steps/)** will help to return one value for a [**TRUE**  ](https://geekexcel.com/use-true-function-in-microsoft-excel-365-simple-methods/)result, and another for a [**FALSE**  ](https://geekexcel.com/use-false-function-in-microsoft-excel-365-simple-methods/)result.
- **Start** – The value represents the starting time from the input.
- **End** – It specifies the end time.
- **Comma symbol (,)** – It is a separator that helps to separate a list of values.
- **Parenthesis ()** – The main purpose of this symbol is to group the elements.
- **Plus operator (+)** – This symbol is used to add the values.
- **Minus Operator (-)** – This symbol will help to subtract any two values.

## Practical Example:

Let’s consider the below example image.

- Here, we will enter the input values in **Column B** and **Column C**.
- Now we are going to find the time duration between these two input times.

![Input Ranges](https://geekexcel.com/wp-content/uploads/2021/05/Input-Ranges.png)<figcaption id="caption-attachment-34925">Input Ranges</figcaption>

- So, apply the above-given formula to the [**formula bar**](https://geekexcel.com/how-to-use-formula-bar-for-various-purpose-in-excel-365/) section and press the  **ENTER**  key.

![Enter the formula](https://geekexcel.com/wp-content/uploads/2021/05/Enter-the-formula.png)<figcaption id="caption-attachment-34924">Enter the formula</figcaption>

- Finally, we will get the result in the selected cell.

![Result](https://geekexcel.com/wp-content/uploads/2021/05/Result.png)<figcaption id="caption-attachment-34926">Result</figcaption>

## Closure:

From this article, you can get to know how to **calculate the number of hours between two times in Excel**. Hope you guys like it. Don’t forget to share your worthwhile feedback with us. Thank you so much for visiting our site. Click here to know more about **[Geek Excel](https://geekexcel.com/) **and [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!! **

### Read Ahead:

- **[Excel Formulas to Add Workdays to Date with Custom Weekends!!](https://geekexcel.com/excel-formulas-to-add-workdays-to-date-with-custom-weekends/)**
- **[Convert Formulas into Values using Macros (VBA) in Excel 365!!](https://geekexcel.com/convert-formulas-into-values-using-macros-vba-in-excel-365/)**
- **[Excel Formulas: Calculate dates overlap in days ~ A Complete Guide!!](https://geekexcel.com/excel-formulas-calculate-date-overlap-in-days/)**