My X-No working day in the weekend (without offs, holidays, sick leaves etc)

songo

New Member
Joined
Apr 16, 2015
Messages
15
Hello guys,


I am trying to figure out formula that will show number of my work day in week, I don't have standard schedule.
Instead i can work Mon,Tue,OFF,Thu,Fri,OFF,Sun or it can be: Mon,OFF, Tue, HOLIDAY,OFF, Fri,Sat,Sun.
Networkday - only counts total days, workday - also doesn't give what i want.


Like on the table below, 2nd column is final result of formula what i am trying to acomplish.

Monday1
Tuesday
2
Wednesday3
OFF
Friday4
OFF
Sunday5
Monday1
HOLIDAY
Wednesday2
Thurday3
OFF
OFF
Sunday4
Monday1

<tbody>
</tbody>
etc...
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Yes, this was clearly defined in post #3 .
But if it were not so, your/our formula could be easily adapted
=IF(B2<>"WORK","",COUNTIFS(A$2:A2,">="&MAX(DATE(YEAR(A2),MONTH(A2),1),A2-WEEKDAY(A2,3)),B$2:B2,"WORK"))
A little more compact and two less function calls...

=IF(B2<>"WORK","",COUNTIFS(A$2:A2,">="&MAX(A2-DAY(A2)+1,A2-WEEKDAY(A2,3)),B$2:B2,"WORK"))
 
Upvote 0
That situation should not be able to occur. In Message #3 , the OP said "...this formula will be used for many people and each month will be separate Sheet."
Ah, I see. Somehow, I paid more attention to your phrase "at least not one that looked like it might go on forever" ;)
 
Last edited:
Upvote 0
... And you came essentially to my formula from Post [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=7]#7 [/URL] ; mine has fewer references to A2...
Well, it is a little different (your function does not use MAX for example). However, in looking at the formula you posted in Message #6 (not #7 by the way), it can be simplified a little bit more while removing a function call and a reference to A2 in the process...

=IF(B2<>"WORK","",COUNTIFS(A$2:A2,">="&A2-WEEKDAY(A2,3),B$2:B2,"WORK"))
 
Last edited:
Upvote 0
Well, it is a little different (your function does not use MAX for example). However, in looking at the formula you posted in Message #6 (not #7 by the way)...
My bad -- it should read Post #9 .

I have used MIN instead of MAX in order to have fewer references to A2.
 
Upvote 0
My bad -- it should read Post #9 .

I have used MIN instead of MAX in order to have fewer references to A2.
I referenced the wrong formula... I forgot we were taking about resetting the count at the beginning of the month (which the OP did not need). The simplified version of your Message #6 formula that I posted in Message #15 still works for the OP's original question though.
 
Upvote 0

Forum statistics

Threads
1,215,364
Messages
6,124,507
Members
449,166
Latest member
hokjock

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