I have a set of data that Id like to automate filling in a table full of string data, based on a given input value, that will add/remove rows as necessary to allow space, and bonus points if I can merge the input value cell to the size of the added list.
As an example for the reference below:
| Input | Output |
|---|---|
| Data 1 | Cell 1, Cell 2, Cell 3, Cell 4 (in individual cells) |
| Data 2 | Cell 1, Cell 2 |
It would output this table, which would update under Cell 4 if i added a cell 5 to Data 1 or at the end if i add a Cell 3 to Data 2
| Inputs | Outputs |
|---|---|
| Data 1 | Cell 1 |
| Cell 2 | |
| Cell 3 | |
| Cell 4 | |
| Data 2 | Cell 1 |
| Cell 2 |
Ive attempted using some index functions with match but cant quite get it to work.
Using this string gets me the references in the format id like, but 'spills' and repeats the references/data many times for Data 1, ignoring if i try to enter a Data2 line. =IFERROR(INDEX($B$2:$B$12,SMALL(IF($A$2:$A$100=H$2,ROW($A$2:$A$100)-1),ROW(1:1)),1),"")
this doesnt get me to merging cells, but even if i could autopopulate these references it would be nice.
tried a few merge options in vba but cant get it consistent.
excel 365, macros available


