working days between hire and term dates

btardo01

Board Regular
Joined
Oct 6, 2009
Messages
169
Office Version
  1. 2016
Platform
  1. Windows
I have an employees start date in cell H11 and the term date in cell I11. In cells J6:U6, I have the months of 1/1/2019 - 12/1/2019. In cells J3:U3, I'm trying to calculate the number of working days that employee worked that month given their starting and term date. If the employee is still active, the term date column would be blank. The hire date could be prior to 1/1/2019 or anytime within the year. There could be a hire date and term date within the same year.

any ideas?
thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Test this:

=IF(MONTH(J6)>MONTH($I$11),0,NETWORKDAYS(MAX($H$11,J6),MIN(IF($I$11="",TODAY(),$I$11),EOMONTH(J6,0))))
 
Upvote 0
Actually this:

=IF(MIN(IF($I$11="",99999,$I$11),EOMONTH(J6,0))>=MAX($H$11,J6),NETWORKDAYS(MAX($H$11,J6),MIN(IF($I$11="",99999,$I$11),EOMONTH(J6,0))),0)
 
Upvote 0
A shorter one; returns zero if the hire date cell is blank:

=NETWORKDAYS(MAX(J6,$H$11),MIN(EOMONTH(J6,0),$I$11))*(IF($H$11="",99999,$H$11) < EDATE(J6,1))*(IF($I$11="",99999,$I$11)>=J6)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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