finding number of sundays and saturdays between tow dates include hours

abdi1

Board Regular
Joined
Aug 22, 2010
Messages
54
hi....i have tow dates in my excel sheet in A2 and A3 which have format ( MM/DD/YYYY HH:MM)
how to find the number Sundays and Saturdays between thous tow dates ...
iv google many pages but all i found have only MM/DD/YYYY format without HH:MM
any help is appreciated
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi,

I don't think the Cell formatting with Time has anything to do with it:

Book3.xlsx
ABC
1Inclusive
201/02/2021 08:1527
304/03/2021 17:00
Sheet889
Cell Formulas
RangeFormula
C2C2=DAYS(A3,A2)-NETWORKDAYS(A2,A3)+1
 
Upvote 0
Hi,

I don't think the Cell formatting with Time has anything to do with it:

Book3.xlsx
ABC
1Inclusive
201/02/2021 08:1527
304/03/2021 17:00
Sheet889
Cell Formulas
RangeFormula
C2C2=DAYS(A3,A2)-NETWORKDAYS(A2,A3)+1
hi thanks for you jtakw
unfortunately i dont have DAYS function in my office......2007 :(
 
Upvote 0
Then try this:

Book3.xlsx
ABCD
1InclusiveOr
201/02/2021 08:152727
304/03/2021 17:00
Sheet889
Cell Formulas
RangeFormula
C2C2=INT(A3-A2-NETWORKDAYS(A2,A3)+1)
D2D2=INT(A3)-INT(A2)-NETWORKDAYS(A2,A3)+1
 
Upvote 0
Solution
i forgut to say
reason for my thread is that i need to count the number of hours between tow dates....one time including Saturdays and Sundays and the other excluding Saturdays and Sundays
 
Upvote 0
Well, that's not what your OP says.
 
Upvote 0
Well, that's not what your OP says.
I Know ...but this is for more explanation of my purpose from this thread my frind :)

any way your excel function works very good..... and if i want to find the number of hours simply i will multiply by 24.....
thanks very much
appreciated
 
Upvote 0
You're welcome, thanks for the feedback.

i forgut to say
reason for my thread is that i need to count the number of hours between tow dates....one time including Saturdays and Sundays and the other excluding Saturdays and Sundays

Here are updated formulas for your latest query, Total Hours between Start and End Date (A2 and A3, respectively), then Total Hours Not counting Sat/Sun (also accounting for the Hours of Start/End Dates if they Don't fall on Sat/Sun):

Book3.xlsx
ABCD
1Total HoursLess Sat/Sun
201/04/2021 08:152192.751616.75
304/05/2021 17:00
Sheet889
Cell Formulas
RangeFormula
C2C2=(A3-A2)*24
D2D2=(NETWORKDAYS(A2,A3)+IF(WEEKDAY(A2,2)<6,1-MOD(A2,1),0)+IF(WEEKDAY(A3,2)<6,MOD(A3,1),0))*24
 
Last edited:
Upvote 0
You're welcome, thanks for the feedback.



Here are updated formulas for your latest query, Total Hours between Start and End Date (A2 and A3, respectively), then Total Hours Not counting Sat/Sun (also accounting for the Hours of Start/End Dates if they Don't fall on Sat/Sun):

Book3.xlsx
ABCD
1Total HoursLess Sat/Sun
201/04/2021 08:152192.751616.75
304/05/2021 17:00
Sheet889
Cell Formulas
RangeFormula
C2C2=(A3-A2)*24
D2D2=(NETWORKDAYS(A2,A3)+IF(WEEKDAY(A2,2)<6,1-MOD(A2,1),0)+IF(WEEKDAY(A3,2)<6,MOD(A3,1),0))*24
hi...sorry for late reply
this is another good way to solve the problem and find the number of hours directly
thanks for you jtakw...
appriciated
 
Upvote 0
You're welcome.

When I posted the formulas in Post #8 above, I knew I was forgetting something.
The NETWORKDAYS function is Inclusive of Start and End Dates, which would automatically add 24 hours to each if it's on a Weekday.
So in my formula where I test the Start and End Dates being on a Weekday (Not Sat/Sun), if 1 or both are on a weekday, we also need to subtract 1 day (24 hours) each and add back the Actual hours base on the Time.

So here's the corrected version that should give you accurate results:

Book3.xlsx
ABCD
1Total HoursLess Sat/Sun
201/04/2021 08:152192.751568.75
304/05/2021 17:00
Sheet889
Cell Formulas
RangeFormula
C2C2=(A3-A2)*24
D2D2=(NETWORKDAYS(A2,A3)+IF(WEEKDAY(A2,2)<6,1-MOD(A2,1)-1,0)+IF(WEEKDAY(A3,2)<6,MOD(A3,1)-1,0))*24
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

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
Back
Top