Excel Formulas to Get Work Hours between Dates with Custom Schedule
Tags: excelformula, excelformulas
Published: 2021-05-24 09:55:37

---
title: Excel Formulas to Get Work Hours between Dates with Custom Schedule
published: true
date: 2021-05-21 09:22:04 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-get-work-hours-between-dates-with-custom-schedule/
---

Let’s say you have 2 dates in cells A1 and B1 indicating starting and ending timestamps of an activity. And you want to calculate how many workings hours the task took based on a certain schedule. How can you calculate them quickly? This guide will show the simple formula to **get the work hours between two dates with a custom schedule in Excel**. Let’s get them below!! 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)

[![Get workdays between two dates with custom schedule](https://geekexcel.com/wp-content/uploads/2021/05/Get-workdays-between-two-dates-with-custom-schedule.png)](https://geekexcel.com/excel-formulas-to-get-work-hours-between-dates-with-custom-schedule/get-workdays-between-two-dates-with-custom-schedule/#main)<figcaption id="caption-attachment-44853">Get workdays between two dates with a custom schedule</figcaption>

## General Formula:

- To calculate the total working hours between two dates with a custom schedule, you can use the below formula.

**=[SUMPRODUCT](https://geekexcel.com/how-to-use-excel-sumproduct-function-in-office-365/)([MID](https://geekexcel.com/how-to-use-mid-function-in-microsoft-excel-365/)(schedule,[WEEKDAY](https://geekexcel.com/how-to-use-weekday-function-in-microsoft-excel-365/)([ROW](https://geekexcel.com/row-function-in-microsoft-excel-365-how-to-use/)([INDIRECT](https://geekexcel.com/use-indirect-function-in-microsoft-excel-365-in-easy-ways/)(start&”:”&end))),1)\*[ISNA](https://geekexcel.com/how-to-use-isna-function-in-microsoft-excel-365/)([MATCH](https://geekexcel.com/how-to-use-match-function-in-microsoft-excel-365/)(ROW(INDIRECT(start&”:”&end)),holidays,0)))**

## Syntax Explanations:

- **SUMPRODUCT – ** The **[SUMPRODUCT function](https://geekexcel.com/how-to-use-excel-sumproduct-function-in-office-365/)** multiplies the corresponding arrays or ranges and returns the sum of the products.
- **MID** – In Excel, the **[MID function](https://geekexcel.com/how-to-use-mid-function-in-microsoft-excel-365/)** helps to extract the number (starting from the left side) or characters from the given string.
- **WEEKDAY** – This function returns a number (ranging from 1 to 7) that represents the day of the week for a given date. Read more on the **[WEEKDAY function](https://geekexcel.com/how-to-use-weekday-function-in-microsoft-excel-365/)**.
- **ROW** – The **[ROW function](https://geekexcel.com/row-function-in-microsoft-excel-365-how-to-use/)** returns the row number for a reference.
- **INDIRECT** – In Excel, this function helps to return a valid reference from a given text string. Read more on the **[INDIRECT function](https://geekexcel.com/use-indirect-function-in-microsoft-excel-365-in-easy-ways/)**.
- **ISNA** – The [**ISNA function**](https://geekexcel.com/how-to-use-isna-function-in-microsoft-excel-365/) will return TRUE when a cell contains the #N/A error and FALSE for any other value, or any other error type.
- **MATCH** – This function helps to locate the position of a lookup value in a row, column, or table. Read more on the **[MATCH function](https://geekexcel.com/how-to-use-match-function-in-microsoft-excel-365/)**.
- **Start**  – It specifies the starting date from your worksheet.
- **End ** – It represents the end date from your worksheet.
- **Schedule** – It specifies the number of working hours per day.
- **Multiplication (\*)** – In this symbol will multiply any two values or numbers.
- **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.

## Practical Example:

Let’s consider the below example image.

- Here, we will enter the input values such as **starting**   **date** ,  **ending**   **date**  in  **Column B**  and  **Column C**.
- Now, we need to find out the total working hours between two dates based on the criteria which are given in **Column D**.

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

- Select any cell and type the above-given formula.

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

- Finally, press  **ENTER**  to get the result out, if you need, drag the fill handle over range to apply the formula.

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

## Conclusion:

So yeah guys this is how we can calculate the **work hours between two dates with a custom schedule in Excel**. I hope you like it. Leave a **comment** or reply below to let me know what you think!

Thank you so much for visiting  **[Geek Excel](https://geekexcel.com/)!! **If you want to learn more helpful formulas, check out [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!! **

### Read Also:

- **[Excel Formulas to Get the Project Start Date ~ Quick Tricks!!](https://geekexcel.com/excel-formulas-to-get-the-project-start-date/)**
- **[Excel Formulas to Calculate the Week Number of the Given Date!!](https://geekexcel.com/excel-formulas-to-calculate-the-week-number-of-the-given-date/)**
- **[How to Find the Last Column of Data in Excel Office 365?](https://geekexcel.com/how-to-find-the-last-column-of-data-in-excel-office-365/)**
- **[How to Enter a Formula in Excel Office 365 ~ Easy Tutorial!!](https://geekexcel.com/how-to-enter-formula-in-excel/)**