3 days in a row, then for 7 consecutive weeks on the day

tmacbees

New Member
Joined
Feb 4, 2023
Messages
5
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi all,

I wonder if someone might be able to help with the following. I think xlookup might be the solution but I can't get my head around it.

The requirement is: If the person you have requested prayers for has passed away, their name is read out during the daily practice for 3 days in a row and then for 7 consecutive weeks on the day of the week of their passing.

Here's a proposeal of how this could look in a way that could then be sortable. I'm using Excel: 365
 

Attachments

  • prayer_days.jpg
    prayer_days.jpg
    129 KB · Views: 13

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
MrExcelPlayground16.xlsx
ABCDE
1NamePassing1/1/2023DatePray for
2John1/1/20231/1/2023 
3Fred1/14/20231/2/2023John
4Harry1/30/20231/3/2023John
5Mary2/3/20231/4/2023John
6Sally2/10/20231/5/2023 
7Joan2/20/20231/6/2023 
8Wilhelm2/25/20231/7/2023 
9Maverick2/26/20231/8/2023John
10Goose2/26/20231/9/2023 
111/10/2023 
121/11/2023 
131/12/2023 
141/13/2023 
151/14/2023 
161/15/2023John, Fred
171/16/2023Fred
181/17/2023Fred
191/18/2023 
201/19/2023 
211/20/2023 
221/21/2023Fred
231/22/2023John
241/23/2023 
251/24/2023 
261/25/2023 
271/26/2023 
281/27/2023 
291/28/2023Fred
301/29/2023John
311/30/2023 
321/31/2023Harry
332/1/2023Harry
342/2/2023Harry
352/3/2023 
362/4/2023Fred, Mary
372/5/2023John, Mary
382/6/2023Harry, Mary
392/7/2023 
402/8/2023 
412/9/2023 
422/10/2023Mary
432/11/2023Fred, Sally
442/12/2023John, Sally
452/13/2023Harry, Sally
462/14/2023 
472/15/2023 
482/16/2023 
492/17/2023Mary, Sally
502/18/2023Fred
512/19/2023John
522/20/2023Harry
532/21/2023Joan
542/22/2023Joan
552/23/2023Joan
562/24/2023Mary, Sally
572/25/2023Fred
582/26/2023Wilhelm
592/27/2023Harry, Joan, Wilhelm, Maverick, Goose
602/28/2023Wilhelm, Maverick, Goose
613/1/2023Maverick, Goose
623/2/2023 
633/3/2023Mary, Sally
643/4/2023Fred, Wilhelm
653/5/2023Maverick, Goose
663/6/2023Harry, Joan
673/7/2023 
683/8/2023 
693/9/2023 
703/10/2023Mary, Sally
713/11/2023Wilhelm
723/12/2023Maverick, Goose
733/13/2023Harry, Joan
743/14/2023 
753/15/2023 
763/16/2023 
773/17/2023Mary, Sally
783/18/2023Wilhelm
793/19/2023Maverick, Goose
803/20/2023Harry, Joan
813/21/2023 
823/22/2023 
833/23/2023 
843/24/2023Mary, Sally
853/25/2023Wilhelm
863/26/2023Maverick, Goose
873/27/2023Joan
883/28/2023 
893/29/2023 
903/30/2023 
913/31/2023Sally
924/1/2023Wilhelm
934/2/2023Maverick, Goose
944/3/2023Joan
954/4/2023 
964/5/2023 
974/6/2023 
984/7/2023 
994/8/2023Wilhelm
1004/9/2023Maverick, Goose
Sheet4
Cell Formulas
RangeFormula
D2:D101D2=SEQUENCE(100,1,C1)
E2:E100E2=TEXTJOIN(", ",TRUE,(IF(SIGN((($D2>$B$2:$B$10)*($D2<=$B$2:$B$10+3))+((WEEKDAY($D2)=WEEKDAY($B$2:$B$10))*($D2<$B$2:$B$10+50)*($D2>$B$2:$B$10))),$A$2:$A$10,"")))
Dynamic array formulas.
 
Upvote 0
Another option, in addition to the solution suggested by James, above...

Create in columns A:B the list with the names and DateOfPassing
Insert in F1 the Date, maybe using the formula =TODAY()
Get the "List of the Date" using in G2 the following Office 365 formula:
Excel Formula:
=LET(Names,A2:B2000,DayDt,F1,dDate,INDEX(Names,0,2),wDay,WEEKDAY(dDate,2),dayList,FILTER(Names,((DayDt-dDate)<4)+((DayDt-dDate)<49)*(wDay=WEEKDAY(DayDt,2))),SORT(dayList,2,-1))
As shown in the attached image and the following XL2BB minisheet
(the week of the day in column C and in F2 are only for visual checking)
Not sure if in ((DayDt-dDate)<4) the "4" has to be 4 or 3; 4 returns today dates including Feb 25, whereas 3 would return dates from Feb 26

Cartel1
ABCDEFGHI
1NameDate of PassingWdayDate:28/02/2023List of the Day
2NVE328-feb-2322NVE328-feb-23
3CGU2527-feb-231CGU2527-feb-23
4GSJ2526-feb-237GSJ2526-feb-23
5YLQ1425-feb-236YLQ1425-feb-23
6WOO1825-feb-236WOO1825-feb-23
7YDN2125-feb-236YDN2125-feb-23
8TXA1024-feb-235BUQ1921-feb-23
9URN1123-feb-234JCA2414-feb-23
10KVJ2222-feb-233
11BUQ1921-feb-232
12EPT519-feb-237
13IMJ1519-feb-237
14OQO218-feb-236
15YTH418-feb-236
16RFY618-feb-236
17TIC818-feb-236
18VCH1218-feb-236
19WGI1317-feb-235
20VTF1617-feb-235
21JCA2414-feb-232
22JKP712-feb-237
Foglio1
Cell Formulas
RangeFormula
F2F2=WEEKDAY(F1,2)
G2:H9G2=LET(Names,A2:B200,DayDt,F1,dDate,INDEX(Names,0,2),wDay,WEEKDAY(dDate,2),dayList,FILTER(Names,((DayDt-dDate)<4)+((DayDt-dDate)<49)*(wDay=WEEKDAY(DayDt,2))),SORT(dayList,2,-1))
C2:C22C2=WEEKDAY(B2,2)
Dynamic array formulas.
 

Attachments

  • DAYLIST_Immagine 2023-02-28 193103.jpg
    DAYLIST_Immagine 2023-02-28 193103.jpg
    124.2 KB · Views: 1
Last edited:
Upvote 0
wao, many thanks for the quick replies. fiddling about with xlookup and also with some help from a colleague we came up with
c12 ==XLOOKUP(B10,$G$2:$G$4,$I$2:$I$4," ")
e12 ==B10+((ROUNDUP((TODAY()-B10)/7,0))*7)
i12 ="=XLOOKUP(B12,$G$9:$G$17,$I$9:$I$17,,-1)"
 

Attachments

  • prayer_days1.jpg
    prayer_days1.jpg
    177.2 KB · Views: 2
Upvote 0
sorry, wrong image
 

Attachments

  • prayer_days2.jpg
    prayer_days2.jpg
    184.1 KB · Views: 5
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,616
Members
449,238
Latest member
wcbyers

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