r/excel • u/newbieRedT • Jul 18 '24
solved vlookup but need to return multiple values (and insert lines)
Here is a image of what I am trying to do:

This is a small example of what I am trying to do. In reality the "data set" is thousands of rows. and the "turn this" is hundreds of rows, with many different "Jobs" and "Access" permutations.
vlookup would work great if "Access" was just had one "code". But since it needs to return multiple values it won't work because it'll stop on the first match only.
The tough part would be having excel insert new rows so it can continue to fill in the values.
Chatgpt help me get to this point:
=TEXTJOIN(", ", TRUE, IF($D$2:$D$10=B14, $E$2:$E$10, ""))
but that puts all the values in the same cell rather than on a new row.
Thank you for any help
•
u/AutoModerator Jul 18 '24
/u/newbieRedT - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
4
u/Anonymous1378 1542 Jul 18 '24
You can achieve this with lambda functions, but the most straightforward approach is just to do a merge in power query.
2
u/MayukhBhattacharya 1327 Jul 18 '24 edited Jul 18 '24
Using Power Query is pretty easy and simple, you need to merge, here is using Excel Formulas:
• OPTION ONE:
• OPTION TWO: Using Power Query
1
u/PaulieThePolarBear 1929 Jul 18 '24
What logic was used to determine the order your rows appear in your output? For example, in your input data, Shipping appears above Display Items for Clerk, but this order is reversed in your desired output.
1
u/Decronym Jul 18 '24 edited Mar 21 '25
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
|-------|---------|---| |||
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #35429 for this sub, first seen 18th Jul 2024, 13:44] [FAQ] [Full list] ^[Contact] [Source code]