Work Days And Hours Between Two Dates & Times - Excel Help & Excel Macro Help
SEARCH ENTIRE SITE LOADING..

Excel Help & Excel Best Practices Forums

 

Proudly Affiliated With: Intelligent Converters & AnalyserXL <Affiliate Program & ExcelUser Affiliate>

 

SPECIALS PAGE FOR BARGAINS | FREE EXCEL TRAINING | FREE CUSTOM FUNCTIONS ADD-IN


Go Back Excel Help & Excel Macro Help > HELP FORUMS > EXCEL HELP
HOME Register Forum Help Calendar Search For Today's Posts Mark Forums Read

Reply

Work Days And Hours Between Two Dates & Times

ANSWERS TO SIMILAR QUESTIONS
Total Sum In Hours Of Dates & TimesDetermine Work Days Between 2 DatesAdd X Hours To Dates And TimesCalculate Work Days Between 2 Dateswork days between two dates



Javascript DHTML Drop Down Menu Powered by dhtml-menu-builder.com

Create Excel dashboards quickly with Plug-N-Play reports.


 
Thread Tools Search this Thread
Old April 7th, 2008
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
TheHobbit81 TheHobbit81 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Just Above Average
Join Date: 17th February 2008
English is 1st Language: Yes
Posts: 18 -- Threads: 3
Work Days And Hours Between Two Dates & Times

Hi

This issue has caused me sleepless night and premature balding, any help would be great.

Scenario:
I am creating a 'HelpDesk Issue Logger' and I am trying to calculate the Network Days and Network Hours between two dates with times. I want to know how many business days and hours are between the two days to give me a TURE 'Response Time.'

I have been to several sites and forums looking for the answer, but I have not been able to find a solutions that works for me. Please find attached a 'stripped' down version of my project.

Variables:
- 'Date Received' (H11)
- 'Date Actioned.' (I11)
-'Response Time' (K11)

Constants:
Work Days = Monday to Friday
Work Hrs = 8:30 AM to 5:30 PM (no lunch break)
Public Holidays = (AC13:AC30)

Formats:
Date Received: dd/mm/yyyy hh:mm AM/PM
Date Actioned: dd/mm/yyyy hh:mm AM/PM
Response Time: d - hh:mm

If there is someone out there wiling to put me out of my missery with this one, you will have a friend for life.

Yours sincerely

The Hobbit 81
AKA.
Paul Hobby
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: zip Test.zip (20.2 KB, 229 views)
__________________
ADS BY OZGRID. FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package. MORE..
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,233 -- Threads: 15169
Re: Network Days And Hours Between Two Dates With Times

What's your question?
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
TheHobbit81 TheHobbit81 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Just Above Average
Join Date: 17th February 2008
English is 1st Language: Yes
Posts: 18 -- Threads: 3
Re: Work Days And Hours Between Two Dates & Times

How to calculate the Network Days and Network Hours between two dates, in my case, Date received and Date actioned should give me a Response time in days and hours.

"I want to know how many business days and hours are between the two days to give me a TURE 'Response Time.'"

The Hobbit 81
Auto Merged Post Until 24 Hrs Passes;

Hi,

I am trying to find out how many Network Days and Network Hours are between 'Date Received' and 'Date Actioned'

The Hobbit 81
__________________
ADS BY OZGRID. FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package. MORE..

Last edited by TheHobbit81 : April 7th, 2008 at 14:55. Reason: Auto Merged Doublepost
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,233 -- Threads: 15169
Re: Work Days And Hours Between Two Dates & Times

From Chip P;

The following formula will return the number of working days and hours between two dates and times. It returns a string like "3 days 2 hours".

=IF(AND(INT(StartDT)=INT(EndDT),NOT(ISNA(MATCH(INT(StartDT),
HolidayList,0)))),"0 days 0 hours", IF(INT(StartDT)=INT(EndDT),
"0 days " & ROUND(24*(EndDT-StartDT),2)&"hours",
MAX(NETWORKDAYS(StartDT+1,EndDT-1,HolidayList),0)+
INT(24*(((EndDT-INT(EndDT))-(StartDT-INT(StartDT)))+
(DayEnd-DayStart))/(24*(DayEnd-DayStart)))&
" days "&MOD(ROUND(((24*(EndDT-INT(EndDT)))-24*DayStart)+
(24*DayEnd-(24*(StartDT-INT(StartDT)))),2),
ROUND((24*(DayEnd-DayStart)),2))&" hours "))
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
TheHobbit81 TheHobbit81 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Just Above Average
Join Date: 17th February 2008
English is 1st Language: Yes
Posts: 18 -- Threads: 3
Re: Work Days And Hours Between Two Dates & Times

I have tried this one before, I don't have much luck, please see attached.

Hobby
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: zip Test.zip (20.6 KB, 157 views)
__________________
ADS BY OZGRID. FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package. MORE..
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,233 -- Threads: 15169
Re: Work Days And Hours Between Two Dates & Times

See attached
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: xls Book1.xls (25.0 KB, 605 views)
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
TheHobbit81 TheHobbit81 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Just Above Average
Join Date: 17th February 2008
English is 1st Language: Yes
Posts: 18 -- Threads: 3
Re: Work Days And Hours Between Two Dates & Times

If I change anything, it changed the result to # Name? which is the same result I get in my 'test.xls'
__________________
ADS BY OZGRID. FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package. MORE..
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
rbrhodes rbrhodes is offline
Have VBA, will travel
 
I'm a Spammer:
MS Office Version: 97 forwards
Op System: Win ME to Win XP
Assumed Experience: ...still learning...
Join Date: 24th December 2004
English is 1st Language: Yes
Location: Nanaimo, Vancouver Island, British Columbia, Canada
Posts: 1,701 -- Threads: 5
Re: Work Days And Hours Between Two Dates & Times

Hi Hob,

On Tools menu Click 'AddIns' and check the box for Analysis Toolpak. it's needed for NETWORKDAYS.

PS Here's Daves formula with the right cells Absolute referenced...

=IF(AND(INT(H11)=INT(I11),NOT(ISNA(MATCH(INT(H11),
$J$2:$J$8,0)))),"0 days 0 hours", IF(INT(H11)=INT(I11),
"0 days " & ROUND(24*(I11-H11),2)&"hours",
MAX(NETWORKDAYS(H11+1,I11-1,$J$2:$J$8),0)+
INT(24*(((I11-INT(I11))-(H11-INT(H11)))+
($I$2-$H$2))/(24*($I$2-$H$2)))&
" days "&MOD(ROUND(((24*(I11-INT(I11)))-24*$H$2)+
(24*$I$2-(24*(H11-INT(H11)))),2),
ROUND((24*(I11-$H$2)),2))&" hours "))
__________________
Cheers,

dr

http://www.members.shaw.ca/ExcelVBA
Print [Post / Thread] Reply With Quote
Old April 7th, 2008
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,233 -- Threads: 15169
Re: Work Days And Hours Between Two Dates & Times

# NAME? means a named range used is not defined OR a Function is NOT being recognized. Have you installed the Analysis Toolpak via Tools>Add-ins?
Do you have names matching those used in the Function?

I used Relative named ranges so the formula can simply be copied/filled down.
Print [Post / Thread] Reply With Quote
Old April 8th, 2008
daddylonglegs's Avatar
daddylonglegs daddylonglegs is offline
OzMVP
 
I'm a Spammer:
MS Office Version: 2003/2007 English
Op System: XP/Vista
Assumed Experience: Formula Expert
Join Date: 24th April 2007
English is 1st Language: Yes
Location: England
Posts: 561 -- Threads: 0
Re: Work Days And Hours Between Two Dates & Times

Hello TheHobbit81

I note that you have examples where the start or end time is outside the business hours, Chip's formula doesn't cater for that.

This formula for row 11 will give you the result in hours

=(NETWORKDAYS(H11,I11,holidays)-1)*(I$2-H$2)+IF(NETWORKDAYS(I11,I11,holidays),MEDIAN(MOD(I11,1),I$2,H$2),I$2)-MEDIAN(NETWORKDAYS(H11,H11,holidays)*MOD(H11,1),I$2,H$2)

Where holidays is a named range containing your holiday dates

format result cells as [h]:mm

If you want the result in days hours and minutes that'll be a little trickier.....
__________________
ADS BY OZGRID. FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package. MORE..
Print [Post / Thread] Reply With Quote
Reply Lifetime Upgrade To Ad Free Styles

   « PREVIOUS Remove/Disable Open File As Read Only Option || Split Function With Line Break Characters NEXT »
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 18:50.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ozgrid is Not Associated With Microsoft. Ozgrid Retains the Rights to ALL Posts and Threads