Filter with TextJoin: Multiple Date Ranges in Non-Consecutive Cells

Pulsar3000

New Member
Joined
Apr 19, 2021
Messages
44
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone:

I'm trying to compare a date to multiple date ranges in non-consecutive cells and if the date falls between the pairs, I want the value preceding the "Start Date" returned.

In the attached example, I want the various colors returned in cell F4 whose date ranges contain the date in cell E4.

I also want the color returned for each occurrence the E4 date was found in the various date ranges. I think the formula in F4 needs the "unique" portion removed.

In the real file I'll be doing this formula in, there will be various dates looked up not just one like in this example but I presume I can just reference the cell with the actual date that needs to be looked up in the formula that I ultimately receive from you.

Look forward to your responses!!

Thank You!
Non-Consecutive Date Ranges.xlsx
EFGHIJKLMNOP
3DateFormula
43/4/2021#VALUE!
5
6Start DateEnd DateStart DateEnd DateStart DateEnd Date
7Blue1/1/20211/7/2021Something 1Something 2Green3/4/20213/15/2021Something 3Yellow3/4/20214/30/2021
Sheet2
Cell Formulas
RangeFormula
F4F4=TEXTJOIN(", ",TRUE,UNIQUE(FILTER((E7)+(J7)+(N7),(F7,K7,O7>=E4)*((G7,L7,P7)<=E4),"")))
 
Before dissecting that formula, what about this simpler one instead?

Pulsar3000.xlsm
DEFGHIJKLMNOP
3TypeDateFormula
4Option 18/03/2021Green, Yellow
5
6
7
8TypeItem 1Vague Description 1 Start DateVague Description 1 End DateSomething 1Something 2Item 2Vague Description 2 Start DateVague Description 2 End DateSomething 3Item 3Vague Description 3 Start DateVague Description 3 End Date
9Option 1Blue1/01/20217/01/2021Something 1Something 2Green3/02/202115/03/2021Something 3Yellow7/03/202130/04/2021
10Option 2Orange3/02/202117/02/2021Something 1Something 2Pink18/02/20217/03/2021Something 3Gray3/02/202123/03/2021
Date Range (2)
Cell Formulas
RangeFormula
F4F4=TEXTJOIN(", ",1,IF(RIGHT(F8:O8,6)="t Date",IF(F9:O10<=E4,IF(G9:P10>=E4,IF(D9:D10=D4,E9:N10,""),""),""),""))
Hi @Peter_SSs

Yes, this works! I'm marking your answer as resolved.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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