Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Conditional Formatting Data bars Examples in Excel
  • How to Create Gantt Chart in Excel
  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • Working With Tables in Excel
  • How To Create Pareto Chart in Excel

References

  • Offset in Excel
  • Extract data with helper column in Excel
  • Convert text string to valid reference in Excel using Indirect function
  • Count rows with at least n matching values
  • To count total rows in a range in Excel

Data Validations

  • Excel Data validation whole percentage only
  • Excel Data validation unique values only
  • Excel Data validation only dates between
  • Excel Data validation must begin with
  • Excel Data validation require unique number

Get work hours between dates in Excel

by

To calculate the total number of work hours between two dates, you can use a formula based on the NETWORKDAYS function, where “start” is the start date, “end” is the end date, “holidays” is a range that includes dates, and “hours” is the number of work hours in a workday.

Formula

=NETWORKDAYS(start,end,holidays)*hours

Explanation

In the example shown, the formula in D7 is:

=NETWORKDAYS(B7,C7,holidays)*8

where “holidays” is the named range G6:G8.

How this formula works

This formula uses the NETWORKDAYS function calculate total working days between two dates, taking into account weekends and (optionally) holidays. Holidays, if provided, must be a range  of valid Excel dates. Once total work days are known, they are simply multiplied by a fixed number of hours per day, 8 in the example shown.

Worked Example:   Get work hours between dates and times in Excel

The NETWORKDAYS function includes both the start and end date in the calculation, and excludes both Saturday and Sunday by default. The function will also exclude holidays when then are provided as the “holidays” argument as a range of valid dates.

Worked Example:   How to get workdays between dates in Excel

In these example shown, the first two formulas use the NETWORKDAYS function.

D6=NETWORKDAYS(B6,C6)*8 // no holidays
D7=NETWORKDAYS(B7,C7,holidays)*8 // holidays provided

If your workweek includes days other than Monday through Friday, you can switch to the NETWORKDAYS.INTL function, which provides a “weekend” argument that can be used to define which days of the week are workdays and weekend days. NETWORKDAYS.INTL can be configured just like NETWORKDAYS, but it provides an additional argument called “weekend” to control which days in a week are considered workdays.

Worked Example:   NETWORKDAYS function: Description, Usage, Syntax, Examples and Explanation

The next 4 formulas use the NETWORKDAYS.INTL function:

D8=NETWORKDAYS.INTL(B8,C8)*8 // Mon-Fri, no holidays
D9=NETWORKDAYS.INTL(B9,C9,11)*8 // Mon-Sat, no holidays
D10=NETWORKDAYS.INTL(B10,C10)*8 // M-F, no holidays
D11=NETWORKDAYS.INTL(B11,C11,1,holidays)*8 // M-F, w/ holidays

Click the function names above to learn more about configuration options.

Custom work schedule

This formula assumes all working days have the same number of work hours. If you need to calculate work hours with a custom schedule where work hours vary according to the day of week, you can try a formula like this:

=SUMPRODUCT(MID(schedule,WEEKDAY(ROW(INDIRECT(start&":"&end))),1)*ISNA(MATCH(ROW(INDIRECT(start&":"&end)),holidays,0)))

Post navigation

Previous Post:

Get day from date in Excel

Next Post:

Calculate loan interest in given year in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • How to use Excel TRUE Function
  • How to use Excel OR Function
  • How to return blank in place of #DIV/0! error in Excel
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel XOR Function

Date Time

  • Custom weekday abbreviation in Excel
  • TIME function: Description, Usage, Syntax, Examples and Explanation
  • Get first day of month in Excel
  • Count holidays between two dates in Excel
  • Convert Unix time stamp to Excel date

Grouping

  • Group times into unequal buckets in Excel
  • How to randomly assign data to groups in Excel
  • Group numbers at uneven intervals in Excel
  • Map text to numbers in Excel
  • Calculate conditional mode with criteria in Excel

General

  • Mark Workbook as Final in Excel
  • Subtotal by color in Excel
  • Automatically fill series of cells in Excel using AutoFill
  • How to create dynamic worksheet reference in Excel
  • How to get original price from percentage discount in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning