Occurances from Monday to Friday Using Actual Dates

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,180
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I would like to thank Alphafrog and Barry Houdini yesterday for their help! What I am trying to do today is to get a count of Monday and Friday based on absences and real dates not ranges. If they occured on Monday and Friday then I would like to have a count. thanks in advance Stephen!

<html><head><title>Excel Jeanie HTML</title></head><body>
Excel Workbook
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASAT
1Teacher IDFirst NameLast Name8/258/268/278/308/319/19/29/39/69/79/89/99/109/139/149/159/169/179/209/219/229/239/249/279/289/299/3010/110/410/510/610/710/810/1110/1210/1310/1410/1510/1810/1910/2010/21Occurances of Mon-Fri
23XXXXXXXXAA0
34XXXXXXXXAA1
45XXXXXXXXA0
56XXXXXXXXA0
67XXXXXXXXAAAAAAAA2
78XXXXXXXXA0
811XXXXXXXXAA0
912XXXXXXXXAAAAAAAAAAAAAAAAAAAAAA4
1013XXXXXXXXAAA0
Sheet1


</body></html>
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I would like to thank Alphafrog and Barry Houdini yesterday for their help! What I am trying to do today is to get a count of Monday and Friday based on absences and real dates not ranges. If they occured on Monday and Friday then I would like to have a count. thanks in advance Stephen!
You want to count Monday's and Friday's marked with "A" ?

=SUMPRODUCT((WEEKDAY(D1:AS1,2)={1;5})*(D2:AS2="A"))
 
Upvote 0
Thanks for the response Biff,

I would like to count absences as 1 if there is an absence on both Friday and the preceeding Monday. the results that I am looking for are in Column AT. Thanks. This was the link that I was helped on yesterday.
http://www.mrexcel.com/forum/showthread.php?t=565356
 
Last edited:
Upvote 0
Upvote 0
Sorry Biff the dates are from 2010, the ones in the yellow are Monday and Friday.
 
Upvote 0
I made a slight modification to Biff's formula, and I think it will give you what you are looking for. Enter it in AT2 and copy it down.

Code:
=SUMPRODUCT((WEEKDAY(D$1:AS$1,2)=1)*(D2:AS2="A")*(OFFSET(D2:AS2,0,-1)="A"))
 
Upvote 0
I made a slight modification to Biff's formula, and I think it will give you what you are looking for. Enter it in AT2 and copy it down.

Code:
=SUMPRODUCT((WEEKDAY(D$1:AS$1,2)=1)*(D2:AS2="A")*(OFFSET(D2:AS2,0,-1)="A"))
I was having a hard time trying to figure this out based on this:

on both Friday and the preceeding Monday.
I interpreted that to mean:

Book1
ABCDEF
1A___A_
2MonTueWedThuFriMon
3this___this_
Sheet3

But, if you look at the expected results it can't be the preceding Monday. It has to be the Friday and the FOLLOWING Monday.
 
Upvote 0
Biff you are right it is Friday and the FOLLOWING Monday. MikeWx the formula worked perfect.


Biff what I am trying to do is see if there is a pattern of taking Friday and Monday off. we already check to see how many Mondays or Fridays they take off but this gives us another piece of data to analyse.

What I would really like to do is have a date range of Holidays and if there is a holiday on Monday or Friday then use the date before either Thursday or Tuesday? Any help would be much appreciated!



<html><head><title>Excel Jeanie HTML</title></head><body>
Excel Workbook
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1Teacher IDFirst NameLast Name8/258/268/278/308/319/19/29/39/79/89/99/109/139/149/159/169/179/209/219/229/239/27CountHolidays
21XXXXXXXXAA19/6/2010
32XXXXXXXXA09/24/2010
43XXXXXXXXAA0
54XXXXXXXXAA1
65XXXXXXXX0
76XXXXXXXXA0
87XXXXXXXXAA0
98XXXXXXXXA0
1011XXXXXXXXA0
1112XXXXXXXXAAAAAAAAAAAAAAAAA4
1213XXXXXXXXAA0
Sheet1


</body></html>
 
Upvote 0
Stephen,

The current format of your calendar doesn't show weekends or holidays that occur on Monday or Friday. The formula I gave earlier will identify the instances where a holiday occurs on Friday and the absences occurs on the occur on the preceding Thursday and the Monday following the holiday. In order to also count the Monday holidays, replace my preceding formula with this one:

Code:
=SUMPRODUCT((WEEKDAY(D$1:Y$1,2)=1)*(D2:Y2="A")*(OFFSET(D2:Y2,0,-1)="A"))+SUMPRODUCT((WEEKDAY(E$1:Y$1,2)=2)*((E$1:Y$1)-OFFSET(E$1:Y$1,0,-1)>1)*(E2:Y2="A")*(OFFSET(E2:Y2,0,-1)="A"))

The new portion determines that a Monday holiday occurred by subtracting the date of the day before each Tueday from the date of Tuesday and identifying the Monday as a holiday if the difference is more than one, since a Monday holiday would not be on the calendar.
 
Upvote 0
MikeWx,

You are the man! Thank you so much it did the job! I appreciate it! Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

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