r/excel • u/SeriousBlackberry621 • Jul 15 '24
solved Complicated VLOOKUP (or not), Needs to enter a name in table and have the corresponding row and column titles fill on the bottom table to show what each person is getting

Hello!
Data labels are adjusted but this is definitely what it needs to look like and makes sense with real values. I need to be able to type a name into the current top table and have the bottom table show the corresponding row and column table titles joined to show what everyone is responsible for. I think this will be a ifvlookup with a concat but can't get it.
The real data has more values and will be adjusted frequently, so a formula is ideal (wanting to avoid powerquery). I have =IF(VLOOKUP(B10:B12,C5:D8,1,FALSE),(TEXTJOIN(" & ",TRUE,B5,C4)),"") but that gives a value! error, will need constants to drag, and more errors I haven't gotten to. Using excel 2406
Thanks for any advice related to this!
•
u/AutoModerator Jul 15 '24
/u/SeriousBlackberry621 - 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.
1
u/PaulieThePolarBear 1929 Jul 15 '24 edited Jul 16 '24
This assumes you are using Excel 365 or Excel online.
The range in variable a is a range covering your input table including row and column headers.
1
u/Gregregious 314 Jul 16 '24 edited Jul 16 '24
This is a horrible data setup but I had fun trying to to fit this inside one formula without using any hardcoded variables.
https://imgur.com/nIHeoas
C10:
=TEXTJOIN(", ",,FILTER(BYROW(LET(x,TRANSPOSE($C$4:$D$4),y,$B$5:$B$8,s,SEQUENCE(ROWS(x)*ROWS(y),1,1),HSTACK(INDEX(y,MOD(s-1,ROWS(y))+1),INDEX(x,ROUNDUP(s/ROWS(y),0)))),LAMBDA(r,TEXTJOIN(" ",,r))),VSTACK($C$5:$C$8,$D$5:$D$8)=B10))I suppose it could be further optimized by dynamically stacking the data columns in the final VSTACK, but my rule of thumb is that if you have to use MMULT in a formula, it's time to give up on that formula.
Edit: just learned about the
TOCOLfunction:=TEXTJOIN(", ",,FILTER(BYROW(LET(x,TRANSPOSE($C$4:$D$4),y,$B$5:$B$8,s,SEQUENCE(ROWS(x)*ROWS(y),1,1),HSTACK(INDEX(y,MOD(s-1,ROWS(y))+1),INDEX(x,ROUNDUP(s/ROWS(y),0)))),LAMBDA(r,TEXTJOIN(" ",,r))),TOCOL($C$5:$D$8)=B10))2
u/MayukhBhattacharya 1327 Jul 16 '24
Here is an alternative way using MS365 Functions:
1
u/[deleted] Jul 15 '24 edited Jul 15 '24
For your H10 cell:
=INDEX(Table1[Color], MATCH(G10, Table1[Fruit], 0)) & “ Fruit and “ & INDEX(Table1[Color], MATCH(G10, Table1[Vegetable], 0)) & “ Vegetable”
Replace Table1[Color] and other references to your actual columns.
You can then add IF function to check if the person has the match in each section, something like:
=IF(ISNUMBER(MATCH(G10, Table1[Fruit], 0)), INDEX(Table1[Color], MATCH(G10, Table1[Fruit], 0)) & “ Fruit”, “”) & IF(ISNUMBER(MATCH(G10, Table1[Vegetable], 0)), “ and “ & INDEX(Table1[Color], MATCH(G10, Table1[Vegetable], 0)) & “ Vegetable”, “”)
1
u/Decronym Jul 15 '24 edited Jul 18 '24
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
NOTE: Decronym for Reddit is no longer supported, and Decronym has moved to 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.
31 acronyms in this thread; the most compressed thread commented on today has 24 acronyms.
[Thread #35342 for this sub, first seen 15th Jul 2024, 23:44] [FAQ] [Full list] ^[Contact] [Source code]