Lookup a date range and return array

MutanGFX

New Member
Joined
Aug 25, 2022
Messages
11
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hello!

What formula can I write in H2 to have it show me an array containing the date, info and color based on today's date + next 7 days?

Book2
ABCDEFGHIJ
1DateInfoColorToday20/10/2022Next 7 days info
220/10/2022JOHNBlueDateInfoColor
320/10/2022KATEGreen20/10/2022JOHNBlue
421/10/2022KEVINPurple20/10/2022KATEGreen
521/10/2022LOUISYellow21/10/2022KEVINPurple
622/10/2022PETERGreen21/10/2022LOUISYellow
723/10/2022EVANBlack22/10/2022PETERGreen
828/10/2022MARIEWhite23/10/2022EVANBlack
930/10/2022JACKPink
Sheet3
Cell Formulas
RangeFormula
F1F1=TODAY()
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try making use of Excel's new FILTER function.
Place this formula in cell H3:
Excel Formula:
=FILTER(A2:C9,(A2:A9>=F1)*(A2:A9<=(F1+7)))

See here for an explanation:
 
Upvote 0
Solution
Try making use of Excel's new FILTER function.
Place this formula in cell H3:
Excel Formula:
=FILTER(A2:C9,(A2:A9>=F1)*(A2:A9<=(F1+7)))

See here for an explanation:

Thank you for the solution. For some reason I was tunnel visioning about using INDEX/MATCH or XLOOKUP in someway.

I just recently started using arrays in my projects.

Now FILTER seems like such an obvious solution. Thank you again!
 
Upvote 0
You are welcome.
Yes, FILTER is a great new function that works perfectly in this instance.
The Spill feature ensures that it will automatically populate all the data needed without you have to copy the formula down.
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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