Counting working Hours in Specific Month between Two Date/times

Taul

Well-known Member
Joined
Oct 24, 2004
Messages
767
Office Version
  1. 2019
Platform
  1. Windows
Hi,
I looking for assistance to modify a formula from Barry Houdini (linked below). The linked formula provides basically what I'm looking for but I would like modify it in two ways:-
1. To show Working hours per month, rather than days.
2. To include Working start time (typically 08:30) and Working End time (typically 17:00), these time may be modified, so I would like them in a separate cell.

Start date & time in cell A2
End date & time in cell B2
Working Start time in cell A7 (08:30)
Working End time in cell B7 (17:00)
Holidays in range Z2:Z10
Formula in C2 and copied across to column N2 to cover the header months 1-Jan-23 to 1-Dec-23 (Rolling months/year in cells C1 to N1)

Is anyone able to assist in modifying the formula please, so far all my attempts have failed.
'=MAX(0,NETWORKDAYS.INTL(MAX(C$1,$A2),MIN(EOMONTH(C$1,0),$B2),"1000011",$Z$2:$Z$10))

You can amend that formula to only show working days based on your definition, so with the same setup, start date in A2, end date in B2 and the 1st of each month in C1 across, try this formula in C2, incorporating Caribeiro77's NETWORKDAYS.INTL suggestion, copied across and down if required

=MAX(0,NETWORKDAYS.INTL(MAX(C$1,$A2),MIN(EOMONTH(C$1,0),$B2),"1000011",$Z$2:$Z$10))

where Z2:Z10 contains your holiday dates, change as required
 
Hi Awoohaw,
Thank you very much, you have certainly put in the effort and the hours, I'm soooo impressed!
I will look at this in more detail later tonight and try and puzzle out how you have done it.

cheers
Paul.
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

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