ChooseCols with VStack and then a filter issue

Spikenaylor

Board Regular
Joined
Apr 14, 2013
Messages
116
Office Version
  1. 365
Platform
  1. Windows
Hi all
I have multiple sheets for different products all with the same columns.
on a summary page I have Vstacked all these tables from each sheet
then I use Choose Cols to return the columns I need, (in this case only 3 columns are returned)

i now need filter these results to only Include where the 3rd column has values matching my requirement.

however the length of the tables and the Vstack will always be changing, therefore my returned columns will alwasy be a different length.

I cannot figure out how to incorporate a dynamic row count in the formula

any help appreciated.

my forumala is

=CHOOSECOLS(VSTACK(Table1, Table2, Table3), 1, 2, MATCH($T$1,Table1[#Headers],0))

The MATCH($T$1,Table1[#Headers],0) gives me the 3rd column to return and it is this column I need to include any rows that match the Value of "C"


where would the Filter clause fit in this formula

I have created another formula to filter the returned range with

=FILTER(W2#,Y2:Y73="C")

however the 73 is changeable and I cannot again figure out how to allow the 73 to change, i.e like RowsCount(VSTACK(Table1, Table2, Table3)

What I eventually need to do is Combine all the tables, Choose the correct columns and filter out to only rows with a "C" in the 3rd column
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
How about
Excel Formula:
=let(a,CHOOSECOLS(VSTACK(Table1, Table2, Table3), 1, 2, MATCH($T$1,Table1[#Headers],0)),filter(a,index(a,,3)="C"))
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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