Multiple Filter() functions in one column

ThatOneDude

New Member
Joined
Aug 11, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet that is performing lookups via the Filter() function through several large databases and importing lots of data from them into the main sheet.

Some of the Filter lookups have multiple results and currently everything is working perfectly by using TEXTJOIN to put all the results into one cell as shown below. There is a formula elsewhere that enters the numbers that are needed and then the names show up automatically. Since they are in consecutive rows, this works perfectly.

Cell Formulas
RangeFormula
E5:E9E5=IF($D5="", "", IFERROR(LET(x,FILTER($U$10:$U$29, (ISNUMBER(SEARCH($D5, $T$10:$T$29)))),TEXTJOIN(CHAR(10),FALSE, IF(x="","*Data Missing*",x))), "Not Listed"))



What I'd really like to do, however, is to not TEXTJOIN them and instead have the formula put the number 1 first, spill down the FILTER results as far as they need to go and then automatically put the number 2 in the next empty row, spill those results down, then enter the number 3 and so on. Sometimes there is only one result. Sometimes there are twenty. I figured VBA was the best, or only, way to do this but I'm not sure how.

Book2
DE
141JIM
15AMY
16JUSTIN
17MICHAEL
18ETHAN
19FRANK
202STEVE
21JAMES
22DENNIS
233LINDSEY
24KRISTINA
254MATT
26ANGELA
27JASON
28JOHN
29PETER
30BRIAN
31CHRIS
32SCOTT
335RYAN
Sheet1
Cell Formulas
RangeFormula
E14:E33E14=IF($D14="", "", IFERROR(LET(x,FILTER($U$10:$U$29, (ISNUMBER(SEARCH($D14, $T$10:$T$29)))),IF(x="","*Data Missing*",x)), "Not Listed"))
Dynamic array formulas.


Thanks for the assistance.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Here is a pretty easy method in Power Query. This will take the data in the table you showed above, and it will create a new table in your desired format (Replace "Table 7" with the name of your source table):

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table7"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Number", Int64.Type}, {"Name", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Name", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Name"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Name", type text}})
in
    #"Changed Type1"
 
Upvote 0
I'm not sure if this will work for me. I provided a very simplistic example of my data set but what really happens is you input a value at the top of the sheet and then 80+ columns are filled with various lookups from 7 different databases located on subsequent sheets. One of those database datasets returns multiple results and those are the ones that need to spill down. Then I would like the next entry on the sheet to appear in the next empty row and then all 80+ columns would fill for that one and spill however far is necessary. I also need all of this to happen automatically after the user makes the entry at the top. This is exactly what's happening now except all the results are text joined in the same cell instead of spilling down.
 
Upvote 0
Then if they simply change the entry at the top, all the data is removed and replaced with the new lookup results.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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