Weekend Time

BCS2

Board Regular
Joined
Dec 8, 2003
Messages
67
I am calculating the difference between a start and a stop time but don't want to include the weekends.

Is there a function to do this?

:rolleyes:
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

BCS2

Board Regular
Joined
Dec 8, 2003
Messages
67
I need to get more specific than just days. I need to be able to determine how many hours and minutes that elapsed between the start and finish times.

By the way, I am having trouble with Colo's HTMLMaker. I had it working yesterday but today it gives me a compile error "'Can't find project or library". I checked the VBA Editor for a "missing" line but there wasn't one in the list. Any ideas?
 

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web

ADVERTISEMENT

which version of html maker do you have? i couldn't get ver 2.41 to work for me, but 1.00 works like a charm. that would really help i think. sounds like a couple of ways to do what you want.
 

jpettit

Board Regular
Joined
Feb 20, 2002
Messages
57
i use:

=IF(INT(StartDT)=INT(EndDT),ROUND(24*(EndDT-StartDT),2),(24*(DayEnd-DayStart)*(MAX(NETWORKDAYS(StartDT+1,EndDT-1,HolidayList),0)+INT(24*(((EndDT-INT(EndDT))-(StartDT-INT(StartDT)))+(DayEnd-DayStart))/(24*(DayEnd-DayStart))))+MOD(ROUND(((24*(EndDT-INT(EndDT)))-24*DayStart)+(24*DayEnd-(24*(StartDT-INT(StartDT)))),2),ROUND((24*(DayEnd-DayStart)),2))))

(which i'm sure can be made simpler!! ;) )

Named Ranges are:
StartDT = Start Time (i.e. 11/05/2003 2:52:12 PM)
EndDT = End Time (i.e. 11/06/2003 1:34:16 PM)
DayStart = Start Time of work (i.e 7 am)
DayEnd = End Time of work (i.e. 5 pm)
HoildayList = Range of cells that are holiday (i.e. Dec 25th, etc), this isn't needed if there are none.

Hope you can figure it out!
 

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web

ADVERTISEMENT

i believe there is a shorter formula.

i came up with:

=(NETWORKDAYS(A1,B1))+((B1-A1)-(NETWORKDAYS(A1,B1))-INT((B1-A1)-(NETWORKDAYS(A1,B1))))

where a1 houses start date and time(must be formatted to date&time), b1 houses end date and time(must be formatted to date&time).

cell w/ formula must be formatted to number w/ 3-4 decimals (for accuracy)

looks like:

hope this helps.
 

BCS2

Board Regular
Joined
Dec 8, 2003
Messages
67
firefytr, that gets me close, but it I need the reult to be expresses in HH:MM. I have formatted cell C1 to [H]:mm, but the result is incorrect. What am I doing wrong?
Estimate Tracking Example.xls
ABCD
11/6/049:42AM1/6/0410:49AM25:07
Sheet1


:oops:
 

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
no your not doing anything wrong. the formula simply displayed it as days w/ 2 decimals. with what you want, it gets more comlicated. since dates can span more than a day, i did it like this:

change formula to (and i know, it's much longer :( ):

=(NETWORKDAYS(A1,B1))&" Days "&INT(((((NETWORKDAYS(A1,B1))+((B1-A1)-(NETWORKDAYS(A1,B1))-INT((B1-A1)-(NETWORKDAYS(A1,B1)))))-INT((NETWORKDAYS(A1,B1))+((B1-A1)-(NETWORKDAYS(A1,B1))-INT((B1-A1)-(NETWORKDAYS(A1,B1))))))*1440)/60)&" Hours "&ROUND((((((NETWORKDAYS(A1,B1))+((B1-A1)-(NETWORKDAYS(A1,B1))-INT((B1-A1)-(NETWORKDAYS(A1,B1)))))-INT((NETWORKDAYS(A1,B1))+((B1-A1)-(NETWORKDAYS(A1,B1))-INT((B1-A1)-(NETWORKDAYS(A1,B1))))))*1440)/60-INT((((NETWORKDAYS(A1,B1))+((B1-A1)-(NETWORKDAYS(A1,B1))-INT((B1-A1)-(NETWORKDAYS(A1,B1)))))-INT((NETWORKDAYS(A1,B1))+((B1-A1)-(NETWORKDAYS(A1,B1))-INT((B1-A1)-(NETWORKDAYS(A1,B1))))))*1440)/60),2)&" Minutes"

w/ "=date(2004,1,1)" in a1, and "=today()+0.167" in b1 (+0.167 for 4 hours - to test with), this is what you should see.
16 Days 4 Hours 0.01 Minutes

you can modify this in any way.

this formula should just give you hours w/ 3 decimal points.

=((INT((NETWORKDAYS(A5,B5))+((B5-A5)-(NETWORKDAYS(A5,B5))-INT((B5-A5)-(NETWORKDAYS(A5,B5))))))*24)+((NETWORKDAYS(A5,B5))+((B5-A5)-(NETWORKDAYS(A5,B5))-INT((B5-A5)-(NETWORKDAYS(A5,B5)))))-INT((NETWORKDAYS(A5,B5))+((B5-A5)-(NETWORKDAYS(A5,B5))-INT((B5-A5)-(NETWORKDAYS(A5,B5)))))

hope this helps you. sorry about the long wait. :confused:

edit: second formula i inserted four rows so all references are 5th row instead of 1st! - i'm sorry for the confustion :oops:
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,326
Members
414,053
Latest member
Dual Showman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top