Return date of Wednesday's during a specific month in a row

BURN11

New Member
Joined
Aug 15, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
A2=1/2023, I need B2 to contain the date of the first Wednesday of 1/2023; B3 to contain the date of the second Wednesday; B4 to contain the date of the third Wednesday; B5 to contain the date of the 4th Wednesday and B6 to contain the date of the 5th Wednesday or "N/A". Continuing this formula for all the months of the year.
Any assistance would be greatly appreciated.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi & welcome to MrExcel.
How about
Fluff.xlsm
AB
1
201/01/202304/01/2023
311/01/2023
418/01/2023
525/01/2023
601/02/2023
708/02/2023
815/02/2023
922/02/2023
1001/03/2023
1108/03/2023
1215/03/2023
1322/03/2023
1429/03/2023
1505/04/2023
1612/04/2023
1719/04/2023
1826/04/2023
1903/05/2023
2010/05/2023
2117/05/2023
2224/05/2023
2331/05/2023
2407/06/2023
2514/06/2023
2621/06/2023
2728/06/2023
2805/07/2023
2912/07/2023
3019/07/2023
3126/07/2023
3202/08/2023
3309/08/2023
3416/08/2023
3523/08/2023
3630/08/2023
3706/09/2023
3813/09/2023
3920/09/2023
4027/09/2023
4104/10/2023
4211/10/2023
4318/10/2023
4425/10/2023
4501/11/2023
4608/11/2023
4715/11/2023
4822/11/2023
4929/11/2023
5006/12/2023
5113/12/2023
5220/12/2023
5327/12/2023
Master
Cell Formulas
RangeFormula
B2:B53B2=WORKDAY.INTL(A2-1,SEQUENCE(52),"1101111")
Dynamic array formulas.
 
Upvote 0
An alternative solution; assuming the blank for the 5th week each month isn't crucial
Book23
AB
201/202304-Jan-23
311-Jan-23
418-Jan-23
525-Jan-23
601-Feb-23
708-Feb-23
815-Feb-23
922-Feb-23
1001-Mar-23
1108-Mar-23
1215-Mar-23
1322-Mar-23
1429-Mar-23
1505-Apr-23
1612-Apr-23
1719-Apr-23
1826-Apr-23
1903-May-23
2010-May-23
2117-May-23
2224-May-23
2331-May-23
2407-Jun-23
2514-Jun-23
2621-Jun-23
2728-Jun-23
2805-Jul-23
2912-Jul-23
3019-Jul-23
3126-Jul-23
3202-Aug-23
3309-Aug-23
3416-Aug-23
3523-Aug-23
3630-Aug-23
3706-Sep-23
3813-Sep-23
3920-Sep-23
4027-Sep-23
4104-Oct-23
4211-Oct-23
4318-Oct-23
4425-Oct-23
4501-Nov-23
4608-Nov-23
4715-Nov-23
4822-Nov-23
4929-Nov-23
5006-Dec-23
5113-Dec-23
5220-Dec-23
5327-Dec-23
Sheet1
Cell Formulas
RangeFormula
B2:B53B2=SEQUENCE((MROUND(EDATE(A2-1,12),7)+4-(MROUND(A2-1,7)+4))/7,,MROUND(A2-1,7)+4,7)
Dynamic array formulas.
 
Upvote 0
First of all, thanks for the assistance. Second, I goofed. I need the dates in a horizontal row with the 5th week either being an actual date or "N/A".
Sorry for the confusion.
 
Upvote 0
Can you post your expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
I'm taking a shot in the dark here:
Book1
ABCDEF
201/202304-Jan-2311-Jan-2318-Jan-2325-Jan-23
302/202301-Feb-2308-Feb-2315-Feb-2322-Feb-23
403/202301-Mar-2308-Mar-2315-Mar-2322-Mar-2329-Mar-23
504/202305-Apr-2312-Apr-2319-Apr-2326-Apr-23
605/202303-May-2310-May-2317-May-2324-May-2331-May-23
706/202307-Jun-2314-Jun-2321-Jun-2328-Jun-23
807/202305-Jul-2312-Jul-2319-Jul-2326-Jul-23
908/202302-Aug-2309-Aug-2316-Aug-2323-Aug-2330-Aug-23
1009/202306-Sep-2313-Sep-2320-Sep-2327-Sep-23
1110/202304-Oct-2311-Oct-2318-Oct-2325-Oct-23
1211/202301-Nov-2308-Nov-2315-Nov-2322-Nov-2329-Nov-23
1312/202306-Dec-2313-Dec-2320-Dec-2327-Dec-23
Sheet2
Cell Formulas
RangeFormula
A2:A13A2=EDATE(DATE(2023,1,1),SEQUENCE(12,,0))
B13:E13,B12:F12,B10:E11,B9:F9,B7:E8,B6:F6,B5:E5,B4:F4,B2:E3B2=SEQUENCE(1,(MROUND(EOMONTH(A2,0),7)+4-(MROUND(A2-1,7)+4))/7,MROUND(A2-1,7)+4,7)
Dynamic array formulas.
 
Upvote 0
Haha, that was how I originally set it up.

I made a LAMBDA out of it. The argument 'DOW' is a number from 1 to 7 where 1 is Monday and 7 is Sunday.

Cell Formulas
RangeFormula
B1:F1B1=SEQUENCE(,5)
B2:F13B2=Nth_DAY_OF_MONTH($A2,3,B$1)
A3:A13A3=EOMONTH(A2,0)+1
Dynamic array formulas.


LAMBDA Funciton
Excel Formula:
=LAMBDA(start_date,dow,nth_day,
    LET(
        dt,WORKDAY.INTL(
            DATE(YEAR(start_date),
            MONTH(start_date),0),
            nth_day,
            REPLACE("1111111",dow,1,"0")
            ),
        IF(MONTH(dt)=MONTH(start_date),dt,NA())
    )
)
 
Upvote 0
Here is a single-cell spill formula for you to try:
Excel Formula:
=LET(d,WORKDAY.INTL(EOMONTH(A2,-1),1,"1101111"),SCAN(d-7,SCAN(d-7,MAKEARRAY(12,5,LAMBDA(r,c,MOD(r-2+MONTH(d),12)+1)),LAMBDA(a,b,a+(MONTH(a+7)=b)*7)),LAMBDA(x,y,IF(x<>y,y,"N/A"))))
 
Upvote 0
WEEKLY CHECKLIST FOR INSPECTION OF EYEWASH
Read ALL instructions prior to inspection
1. Ensure that the path to the eyewash is not obstructed, accessible within 10 seconds or 55 feet, well lit and highly visible.
2. Verify that nozzle caps are in place to prevent contamination and that the nozzles, nozzle caps, and bowl/sink are clean and sanitary.
3. Where feasible, place a catch pan or bucket under the unit if a plumbed drain is not available.
4. Actuate valve to full open position. Water must flow within 1 second.
5. Verify that nozzle caps come off when the eyewash or drench hose is activated.
6. Verify water continues to flow until manually turned off and can be used without requiring the use of the operator’s hands.
7. Look at the flow pattern. It should provide a gentle (30-90 PSI) non-injurious flow. If a dual-stream eyewash, both streams should rise to equal height in a pattern that will flush both eyes simultaneously. Height of fluid flow pattern is 33 - 53 inches from the surface the user stands on and at least 0.6 inches from the wall.
8. Run water for 1-2 minutes to see that there is proper flow and that running water does not appear dirty or cloudy.
9. Report problems to safety and FM and/or start work task order if our facility.
MonthDate and initial below to show above items have been checkedNote Problems
Make sure to report
Jan-23Week 1Week 2Week 3Week 4Week 5 or NA
Feb-23Week 1Week 2Week 3Week 4Week 5 or NA
Mar-23Week 1Week 2Week 3Week 4Week 5 or NA
Apr-23Week 1Week 2Week 3Week 4Week 5 or NA
May-23Week 1Week 2Week 3Week 4Week 5 or NA
Jun-23Week 1Week 2Week 3Week 4Week 5 or NA
Jul-23Week 1Week 2Week 3Week 4Week 5 or NA
23-AugWeek 1Week 2Week 3Week 4Week 5 or NA
23-SepWeek 1Week 2Week 3Week 4Week 5 or NA
23-OctWeek 1Week 2Week 3Week 4Week 5 or NA
23-NovWeek 1Week 2Week 3Week 4Week 5 or NA
23-DecWeek 1Week 2Week 3Week 4Week 5 or NA
 
Upvote 0
N.B. Your Month column must be an actual date Jan 1 2023 etc.
I included an example. You can format it to your preferences.
If you want to add text or check marks, convert the entire range to value.
The previous posts are excellent suggestions but I tried to make the solution less complex.

You can copy the post to a clean sheet.
Click on the icon below the f(x) in the heading, move to your sheet and select cell and paste.


Cell Formulas
RangeFormula
D23:H34D23=LET(x,WORKDAY.INTL($C23-1,D$22,"1101111"),IF(MONTH(x)=MONTH(C23),x,"N/A"))
 
Upvote 0

Forum statistics

Threads
1,215,151
Messages
6,123,321
Members
449,094
Latest member
Chestertim

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