Forum Discussion
Excel Filter Function - Use Same Formula Across Multiple Cells
- Nov 11, 2020
Conceptually, you appear to be looking to produce an array or arrays which, sadly, Excel does not traditionally support. As was suggested, the TRANSPOSE function would allow your list of matched country names to spill horizontally, so allowing multiple lists to be stacked vertically. This would, though, require the formula to be copied down.
Dressed up, the same formula could be written in the form
= LET( matches, ISNUMBER(SEARCH(@PartialName, Map[Name])), matchingNames, FILTER(Map[Name], matches,"Not Found"), TRANSPOSE(matchingNames) )
I don't have the FILTER or SORT functions, so I can't test with those particular functions. But, you might try using textjoin to join your arrays and then filter again:
=FILTERXML("<L><I>"&TEXTJOIN("</I><I>",TRUE,IF(ISNUMBER(SEARCH(TRANSPOSE(A1:A2),MAP[Name])),MAP[Name],""))&"</I></L>","//I")
And, you'll likely need to wrap it with iferror (or some conditional test) in case none of the items exist.