My formula isn't picking up single day entries for absence.

maxim642

Board Regular
Joined
Feb 4, 2021
Messages
91
Office Version
  1. 365
Platform
  1. MacOS
=MAX(0,NETWORKDAYS(MAX(S$1,$G18),MIN(DATE(YEAR(S$1),MONTH(S$1)+1,0),$H18)))

In columns G & H I have the start and end dates respectively for when someone is absent from work. Columns S:AD have dates in them (the start of every month, Jan-Dec 2021.

The above formula is picking up the work days in between the dates when there is more than one day in between, but instances where the person is off for only 1 day just result in a "0", e.g. 07/02/2021 (Start), 07/02/2021 (End).

Maybe I need to create a helper column?? Any help is greatly appreciated.
 
My formula was based on the one that you provided as an example, I'm going to hazard a guess that it needs to go into the Jan column then be filled to the right for it to work.
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Yep, you're correct. I was being an idiot. I forgot I had a filter on my data so I wasn't pasting into the correct cells. Thanks for your patience. It's producing the correct values now. This has been super helpful.

One quick question, what do the x7 zeros at the end of the formula mean/do? Thanks.
 
Upvote 0
Ok, so this is the last question...there are a small handful of records not being picked up (below). They're all the end of the month, Any, quick way around that? Thanks once again for your help.

1637003767877.png
 
Upvote 0
They're all the end of the month, Any, quick way around that?
That was me having a brainfart, correct formula (for January row 18) should be
Excel Formula:
=MAX(0,NETWORKDAYS.INTL(MAX(S$1,$G18),MIN(EOMONTH(S$1,0),$H18),"0000000"))
One quick question, what do the x7 zeros at the end of the formula mean/do?
They set the working week, the 7 zeros represent a week of monday to sunday, 0 denotes a working day, 1 denotes a weekend day to be ignored by the count, so for a normal week of monday to friday you would use "0000011" to exclude saturday and sunday as weekend days.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,606
Messages
6,120,484
Members
448,967
Latest member
visheshkotha

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