One formula to count all ADs on workdays in a month

Retroshift

Board Regular
Joined
Sep 20, 2016
Messages
119
Office Version
  1. 2019
Platform
  1. Windows
Hi, I am looking for one Excel formula to put in cell A1 that counts all AD values on workdays (not weekends nor holiday 2-01) from the beginning to the end of the month.
The dates (see image) are in row 2, the values in row 3.
I am struggling with this.
Formula to count all ADs in workdays.jpg
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
press ctrl shift enter while entering this
I don't know what you mean by holidays, you need to provide a list for holidays separately, this formula will count the values of AD on workdays

=SUMPRODUCT(--(IF(--(WEEKDAY($B$2:$G$2,2)<>6)*--(WEEKDAY($B$2:$G$2,2)<>7),$B$3:$G$3)="AD"))
 

Attachments

  • wwwwww.PNG
    wwwwww.PNG
    33.6 KB · Views: 8
Upvote 0
Let's say Mon 2-01 (cell C2) and Tue 3-01 (cell D2) are holidays referenced in the range "A2:A3", how can I exclude those holidays just like you excluded the weekends in the above formula?
 
Upvote 0
How about
Excel Formula:
=SUMPRODUCT((B3:AF3="AD")*(WEEKDAY(B2:AF2,2)<6)*(ISNA(MATCH(B2:AF2,A2:A3,0))))
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,963
Members
449,094
Latest member
Anshu121

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