Forum Discussion
arisblan
Feb 20, 2025Copper Contributor
Dynamic Array filter multiple values
Is there a method to use the FILTER formula for filtering "table 1" based on values of table 2
thanks for helping
One more
=FILTER( Table1, COUNTIF(Table2[Filter], Table1[Year]), "no data" )
11 Replies
- PeterBartholomew1Silver Contributor
Just to have choice
= REDUCE(Table1[#Headers],Table2, LAMBDA(acc,criterion, VSTACK(acc, FILTER(Table1, Table1[Year]=criterion)) ) )This performs repeated filter steps and stacks the results.
- SergeiBaklanDiamond Contributor
PeterBartholomew1 , IMHO, that's overcomplicated. You iterate criteria and stack them into result with high-level functions. Calc engine in any of xxIFS function combines criteria on boolean AND applying filter to source data. My guess calc engine shall do that more efficiency.
- PeterBartholomew1Silver Contributor
Agreed.
- SergeiBaklanDiamond Contributor
One more
=FILTER( Table1, COUNTIF(Table2[Filter], Table1[Year]), "no data" ) - PeterBartholomew1Silver Contributor
Alternatively
= FILTER(Table1, BYROW(Table1[Year]=TOROW(Table2), OR)) =FILTER(Table1, ISNUMBER(XMATCH(Table1[YEAR], Table2[FILTER])), "")
- arisblanCopper Contributor
everything works!! thank you so much