filter from filtered array

tminhv

New Member
Joined
Jun 29, 2023
Messages
16
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
I'm trying to create a filter based on a filtered array as the conditions. Trying to get =FILTER('location contents'!$E:$E,'location contents'!$A:$A=FILTER('cut history'!$E:$E,('cut history'!$K:$K=B36)*('cut history'!$L:$L=A36)*('cut history'!$A:$A=G36),""),"") to work.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
It looks like you are attempting to filter by a list of values, in which case you can try using ISNUMBER-XMATCH. For example:

Excel Formula:
=LET(
    lookup_arr, FILTER('cut history'!$E:$E,('cut history'!$K:$K=B36)*('cut history'!$L:$L=A36)*('cut history'!$A:$A=G36),""),
    FILTER('location contents'!$E:$E,ISNUMBER(XMATCH('location contents'!$A:$A,lookup_arr)),"")
)

I'm not a huge fan of referencing entire worksheet columns, as it can affect overall performance. It would be better to limit the references to a reasonable amount of rows in relation to your dataset.

Having said that, you could also SORT the lookup_arr, then set the optional [search_mode] argument of XMATCH to 2 - binary seach (sorted ascending order) to help speed things up:

Excel Formula:
=LET(
    lookup_arr, SORT(FILTER('cut history'!$E:$E,('cut history'!$K:$K=B36)*('cut history'!$L:$L=A36)*('cut history'!$A:$A=G36),"")),
    FILTER('location contents'!$E:$E,ISNUMBER(XMATCH('location contents'!$A:$A,lookup_arr,,2)),"")
)

Hopefully that's what you were aiming for. ;)
 
Upvote 1
Solution
It looks like you are attempting to filter by a list of values, in which case you can try using ISNUMBER-XMATCH. For example:

Excel Formula:
=LET(
    lookup_arr, FILTER('cut history'!$E:$E,('cut history'!$K:$K=B36)*('cut history'!$L:$L=A36)*('cut history'!$A:$A=G36),""),
    FILTER('location contents'!$E:$E,ISNUMBER(XMATCH('location contents'!$A:$A,lookup_arr)),"")
)

I'm not a huge fan of referencing entire worksheet columns, as it can affect overall performance. It would be better to limit the references to a reasonable amount of rows in relation to your dataset.

Having said that, you could also SORT the lookup_arr, then set the optional [search_mode] argument of XMATCH to 2 - binary seach (sorted ascending order) to help speed things up:

Excel Formula:
=LET(
    lookup_arr, SORT(FILTER('cut history'!$E:$E,('cut history'!$K:$K=B36)*('cut history'!$L:$L=A36)*('cut history'!$A:$A=G36),"")),
    FILTER('location contents'!$E:$E,ISNUMBER(XMATCH('location contents'!$A:$A,lookup_arr,,2)),"")
)

Hopefully that's what you were aiming for. ;)
It works perfectly! Thank you so much for your help.
 
Upvote 0

Forum statistics

Threads
1,223,606
Messages
6,173,323
Members
452,510
Latest member
RCan29

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