ExcelTip.com
ExcelTip.com
Account Icon Account Icon Account Icon
Google Exceltip.com
JOIN OUR NEWSLETTER
  and receive for joining:
Free eBook Learn More!
Free Excel ADD-IN
Free Weekly Excel Tip
4 e-books in cd-rom
F1 Formulas & Functions
F1 Formulas & Functions
F1 EXCEL
F1 eBook (Spanish)
F1 EXCEL
Financial Statements.xls
 

» Calculating the Number of Weekday Hours Between Two Dates


Problem:
Calculating the number of hours between Date1 and Date2, excluding weekends.

Solution:
Use the NETWORKDAYS and MOD functions as shown in the following formula:
=NETWORKDAYS(A2,B2)-1-MOD(A2,1)+MOD(B2,1)


Example:

Date1_______________Date2________________Result
4/4/2005 10:30______14/4/2005 19:12______200:42

Screenshot // Calculating the Number of Weekday Hours Between Two Dates

Calculating the Number of Weekday Hours Between Two Dates
Rate this tip
12 34 5
  RATING: 3.43
  VIEWS: 32683

READER COMMENTS (view all comments)


Wouldn't WORK hours be more useful?
Andy Black wrote on July 15, 2005 12:25 EST
Hi -- what should be the format for the result cells?
Also, if there are 8 WORKING days, and assuming an 8 hr day, wouldn't an answer of 64 hours be more useful? Maybe start and end times for the work day could be parameter cells?
Reply: Andy Black
Alan wrote on July 27, 2005 02:21 EST
Hi Andy Black,

[QUOTE=Andy Black]Hi -- what should be the format for the result cells?
Also, if there are 8 WORKING days, and assuming an 8 hr day, wouldn't an answer of 64 hours be more useful? Maybe start and end times for the work day could be parameter cells?[/QUOTE]See here

[url]http://groups.google.co.nz/groups?q=excel+working+hours+between+two+dates&hl=en[/url]

Alan.
Calculating time and date
dyeargers wrote on December 31, 1969 19:00 EST
I used this formula, but only the time calculated. The date was ignored. Help! We only have Windows 98 and Excel XR-2. Is that the problem?
Help on count command
Santosh Joshi wrote on December 31, 1969 19:00 EST
Dear Sir,

Need your valuable guidance on count commands in excel. I'm using excel 2000. Pls mail me your mail id to send you attachment of the calculations I wanted to do.

Regards,
Santosh

HolyHacker wrote on December 31, 1969 19:00 EST
Yeah, you must have the Analysis TookPack installed to use this function. It's comes with Excel. Look under Tools>Add Ins.

Your friend,
HH
It does not work
princyvarghese wrote on October 18, 2006 11:33 EST
I dont understand why this formula doesnot work on my Excel worksheet please help I am using XP standard Excel please help! :(
Not sure if this is what you need or not
bakfam7854 wrote on November 04, 2006 14:02 EST
See my post [U]monitor excess time used for a service[/U]. Maybe this is what you're looking for.
This formula is not accurate.
mjdjunk wrote on July 17, 2007 17:19 EST
This formula is accurate about 50% of the time. I used it to calculate the hours for 160 instances and after manually verifying the calculation on some of these instances it was wrong on about half of them. For instance, the formula yielded the result of 1 hour 55 minutes for the time period between 4/10/07 1:18 PM and 4/11/07 3:13 PM. On the flip side, it was entirely accurate when calculation the hours between 11/6/06 5:15 PM and 11/7/06 9:46 AM (16 hours, 31 minutes.)

daddylonglegs wrote on July 17, 2007 17:37 EST
hello mjdjunk,

which formula are you using? If you have start date/time in A2 and end date/time in B2 then

=NETWORKDAYS(A2,B2)-1-MOD(A2,1)+MOD(B2,1)

should give you the correct result

[B]format result cell as [h]:mm otherwise you'll see 1:55 instead of 25:55[/B]

A2 and B2 should not be at the weekend (if you have start or end times at the weekend then you'll need a revised formula)



REGISTERED USERS - Click here to post comments


GUESTS (Click here to register)
Name
Comment Title
Comments

The 11 Immutable Laws of Internet Branding

The Essential 55: An Award-Winning Educator's Rules for Discovering the Successful Student in Every Child

Windows XP for Dummies

The Accounting Game : Basic Accounting Fresh from the Lemonade Stand

Microsoft Access Version 2002 Step by Step

Getting to Yes: Negotiating Agreement Without Giving In

RELATED MICROSOFT EXCEL TIPS


Convert PDF Files to Excel


Excel VBA books
Accounting books
Business Plans
MS Office books
Taxes books

VIEW ALL BOOKS


  Advertise With Us                               

Tips

Add-In in VBA | Applications - Word, Outlook in VBA | Array Formulas | Cells, Ranges, Rows, and Columns in VBA | Counting | Custom Functions | Custom Functions in VBA | Database Formulas | Database in VBA | Date & Time Formulas | Date & Time in VBA | Events in VBA | Excel 2003 | Excel Chart | Excel Consolidating | Excel Counting | Excel Custom Functions using VBA | Excel Customizing | Excel Data | Excel Dates | Excel Editing | Excel Files | Excel Filter | Excel Format | Excel Formula | Excel General | Excel Grouping and Outlining | Excel Importing Text Files | Excel Information | Excel Keyboard Shortcuts | Excel Loan Formulas | Excel Macros - VBA | Excel Pivot Tables | Excel Printing | Excel Range Name | Excel Security - Protection | Excel Sorting | Excel Style | Excel Subtotals | Excel Summing | Excel Text | Excel Time | Excel Tools | Excel Worksheet, Workbook | Files, Workbook, and Worksheets in VBA | Financial Formulas | Formating in VBA | General Topics in VBA | Import and Export in VBA | Information Formulas | Keyboard & Other Shortcuts in VBA | Keyboard Formula Shortcuts | Links between Worksheet and Workbooks | Links in VBA | Logical Formulas | Lookup Formulas | Mail - Send and Receive in VBA | Menus, Toolbars, Status bar in VBA | Modules, Class Modules in VBA | Other Q&A Formulas | Printing in VBA | Protecting in VBA | Summing | Text Formulas | User Forms, Input boxes in VBA | Using Loops | Working with Formulas |

Tips by Version

Microsoft Excel 97 | Microsoft Excel 2000 | Microsoft Excel 2002 | All Microsoft Excel Versions | New in Excel 2002 | New in Excel 2003 - Office 11

Website

Home | Tip of Hour | Recommended Tips | Most Viewed Tips | Tips by Version | Submit a Tip | My Tips
Microsoft Excel Tutorials | Excel Links | Write for Us | About Us | Search Results | Tip Archives | Excel Forum | Excel Forum Archives

Excel Book

Excel 97 Book | Excel 2000 Book | Excel 2002 Book | Excel XP Book | Book Store

Terms and Conditions of use
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Copyright © 2003 ExcelTip.com
Microsoft, Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Site Developed By: Varien