Match date with values on lists (with conditions on each list)

RonOliver

Board Regular
Joined
Aug 30, 2022
Messages
82
Office Version
  1. 365
Platform
  1. Windows
Hi.

Book1.xlsx
ABCDEFGHIJ
1DragonfruitPearMangoBananaAppleStrawberryPomegranate
2
310/31/2210/31/2210/31/2209/29/2210/31/2209/26/22
4MON/WEDStrawberry02/03/2312/05/2203/16/2310/31/2202/03/23
5TUE/THUBanana03/16/2303/17/2303/17/2312/05/2203/16/23
609/26/2203/17/2303/17/2303/17/23
7
8
9True or false?
10
Sheet1


Let me tell you what I'm looking for:

I need a formula that checks if the date in B6 matches any of the dates from the range on the right, and then returns "TRUE" if the column where the matching date is located also matches B4 (if the date is a Monday or a Wednesday) or B5 (if the date is a Tuesday or a Thursday). If it doesn't, I'd like for it to return "FALSE". If this is too hard or convoluted, I would also be happy with the formula if it doesn't check what the date is, as long as it matches either B4 or B5. Thanks for your help!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I'm not sure I understand what you are trying to do. Both can't be true as the day of the week can only match one of the items.
Maybe something like this, if you are looking at them individually?

Book3
ABCDEFGHIJ
1DragonfruitPearMangoBananaAppleStrawberryPomegranate
2
310/31/202210/31/202210/31/202211/29/202210/31/20229/26/2022
4MON/WEDStrawberryTRUE2/3/202312/5/20223/16/202310/31/20222/3/2023
5TUE/THUBananaFALSE3/16/20233/17/20233/17/202312/5/20223/16/2023
69/26/20223/17/20239/26/20223/17/2023
Sheet1
Cell Formulas
RangeFormula
C4:C5C4=IF(ISNUMBER(SEARCH(TEXT($B$6,"ddd"),A4)),IF(FILTER(FILTER($D$3:$J$6,$D$1:$J$1=B4,"FALSE"),FILTER($D$3:$J$6,$D$1:$J$1=B4,"FALSE")=$B$6,"FALSE"),TRUE,FALSE))
 
Upvote 0
I'm not sure I understand what you are trying to do. Both can't be true as the day of the week can only match one of the items.
Maybe something like this, if you are looking at them individually?

Book3
ABCDEFGHIJ
1DragonfruitPearMangoBananaAppleStrawberryPomegranate
2
310/31/202210/31/202210/31/202211/29/202210/31/20229/26/2022
4MON/WEDStrawberryTRUE2/3/202312/5/20223/16/202310/31/20222/3/2023
5TUE/THUBananaFALSE3/16/20233/17/20233/17/202312/5/20223/16/2023
69/26/20223/17/20239/26/20223/17/2023
Sheet1
Cell Formulas
RangeFormula
C4:C5C4=IF(ISNUMBER(SEARCH(TEXT($B$6,"ddd"),A4)),IF(FILTER(FILTER($D$3:$J$6,$D$1:$J$1=B4,"FALSE"),FILTER($D$3:$J$6,$D$1:$J$1=B4,"FALSE")=$B$6,"FALSE"),TRUE,FALSE))
Yes. I need something like that, but in just one formula. Here is my attempt (Mind you I'm very inexperience, so the code is probably going to be atrocious):

Book1.xlsx
ABCDEFGHIJ
1DragonfruitPearMangoBananaAppleStrawberryPomegranate
2
310/31/2210/31/2210/31/2209/29/2210/31/2209/26/22
4MON/WEDStrawberry02/03/2312/05/2203/16/2310/31/2202/03/23
5TUE/THUBanana03/16/2303/17/2303/17/2312/05/2203/16/23
609/26/2203/17/2303/17/2303/17/23
7
8
9True or false?TRUE
10
Sheet1
Cell Formulas
RangeFormula
B9B9=IF(OR(AND(OR(WEEKDAY(B6,2)=1,WEEKDAY(B6,2)=3),OR(HLOOKUP($B$4,$D$1:$J$10,{3,4,5,6,7,8,9,10},0)=B6)),AND(OR(WEEKDAY(B6,2)=2,WEEKDAY(B6,2)=4),OR(HLOOKUP($B$5,$D$1:$J$10,{3,4,5,6,7,8,9,10},0)=B6))),TRUE,FALSE)


If there is a way to shorten it or improve it in any way, I would really appreciate it.
 
Upvote 0
How about
Excel Formula:
=ISNUMBER(MATCH(B6,CHOOSECOLS(D3:J6,MAX(IFNA(MATCH(IF(ISNUMBER(SEARCH(TEXT(B6,"ddd"),A4:A5)),B4:B5,0),D1:J1,0),0))),0))
 
Upvote 0
Solution
How about
Excel Formula:
=ISNUMBER(MATCH(B6,CHOOSECOLS(D3:J6,MAX(IFNA(MATCH(IF(ISNUMBER(SEARCH(TEXT(B6,"ddd"),A4:A5)),B4:B5,0),D1:J1,0),0))),0))
OK, now this is disturbing. I don't even know how you did that without WEEKDAY. I don't understand the formula at all, but I've tested it for a few minutes and it amazingly works. What kind of sorcery is this? Thank you so very much. I'll spend the next few weeks trying to figure out how the formula works and replace my own formula. :)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,015
Members
449,060
Latest member
LinusJE

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