ThatOneDude
New Member
- Joined
- Aug 11, 2022
- Messages
- 24
- Office Version
- 365
- Platform
- 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.
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.
Thanks for the assistance.
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.
Book2 | ||||
---|---|---|---|---|
D | E | |||
4 | Number | Name | ||
5 | 1 | JIM AMY JUSTIN MICHAEL ETHAN FRANK | ||
6 | 2 | STEVE JAMES DENNIS | ||
7 | 3 | LINDSEY KRISTINA | ||
8 | 4 | MATT ANGELA JASON JOHN PETER BRIAN CHRIS SCOTT | ||
9 | 5 | RYAN | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E5:E9 | E5 | =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 | ||||
---|---|---|---|---|
D | E | |||
14 | 1 | JIM | ||
15 | AMY | |||
16 | JUSTIN | |||
17 | MICHAEL | |||
18 | ETHAN | |||
19 | FRANK | |||
20 | 2 | STEVE | ||
21 | JAMES | |||
22 | DENNIS | |||
23 | 3 | LINDSEY | ||
24 | KRISTINA | |||
25 | 4 | MATT | ||
26 | ANGELA | |||
27 | JASON | |||
28 | JOHN | |||
29 | PETER | |||
30 | BRIAN | |||
31 | CHRIS | |||
32 | SCOTT | |||
33 | 5 | RYAN | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E14:E33 | E14 | =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.