How to Create Dynamic Filter Array

jakeman

Active Member
Joined
Apr 29, 2008
Messages
325
Office Version
  1. 365
Platform
  1. Windows
I built a filter for records using the FILTER function and so far it works great. The problem is that I have a need to make one aspect of my filter dynamic but I am not able to do it.

Here is my current formula.
Excel Formula:
=FILTER(INDEX(table1,SEQUENCE(ROWS(table1)),{1,6,17}),table1[LC1▲]=1)

The array constant part works fine but I realized that I have a need to change which columns I want to show in my formula and my preference would be to change the array constant to a dynamic array instead. I've tried different combinations but I cannot get anything to work. So instead of {1,6,17}, I'd prefer to use a range like B3:B5, which contains 3 different numbers that can change depending on selections made elsewhere.

Can anyone lend any ideas?

Thank you!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How about
Excel Formula:
=FILTER(CHOOSECOLS(Table1,B3:B5),Table1[LC1▲]=1)
 
Upvote 0
Thank you, Fluff.

For some reason, my version of Office 365 does not have this function available. I'm on Office 365 Enterprise.

Any thoughts on a workaround approach?
 
Upvote 0
Ok, you'll probably get the new functions in January, but how about
Excel Formula:
=FILTER(INDEX(Table1,SEQUENCE(ROWS(Table1)),TRANSPOSE(B3:B5)),Table1[LC1▲]=1)
 
Upvote 0
Solution
This works beautifully. I have not seen the TRANSPOSE function in use before so that was clearly the missing piece for my function.

Thank you!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,207
Members
449,214
Latest member
mr_ordinaryboy

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