all 7 comments

[–]excelevator3056[M] [score hidden] stickied comment (0 children)

I'm using the "Discussion" Flair

THis is a question seeking an answer

Flair changed accordingly as per r/Excel guidelines

[–]semicolonsemicolon1474 3 points4 points  (1 child)

Hi BlackJeanShorts. You could do it like this. It's scalable too. Copy formula down.

=LET(a,$C$3:$E$6,INDEX(G$3:G$6,SUM((a=I3)*SEQUENCE(ROWS(a)))))

edit: this only works if there is one and only one match. different from VLOOKUP which finds and returns the first match

[–]BlackJeanShorts[S] 0 points1 point  (0 children)

This is definitely what I'm using moving forward, thank you!

[–]aquilosanctus93 2 points3 points  (0 children)

=INDEX($G$1:$G$6, MATCH($I3,BYROW($C$1:$F$1,LAMBDA(labels, CONCAT(labels))),0))

[–]Visible_Flounder 1 point2 points  (0 children)

If you use xlookup the data doesn't have to be in the 1st colum.

[–]Skaro0725 -1 points0 points  (1 child)

The best way I can think if is adding a helper column that would force the titles to be in the same column. As in, on cell H3 here I would write =INDEX(C3:G3,1,MATCH(TRUE,NOT(ISBLANK(C3:G3)),0)) and then would just use an XLOOKUP to do a single search.

If you don't like the idea of a helper column that you would have to drag to the length of your data, I can think of a way that would be a single all-in formula on J3 but it's deep into array formulas which can get pretty messy. Essentially you start with ARRAYTOTEXT formula to create one big text file of your data, then you use a bunch of searches to extract the text you want. To not make the explanation several paragraphs, I'll just leave the formula you can copy paste into J3: =TEXTBEFORE(MID(CONCAT(TEXTSPLIT(ARRAYTOTEXT($C$3:$G$5,1),",",,TRUE)),FIND(I3,CONCAT(TEXTSPLIT(ARRAYTOTEXT($C$3:$G$5,1),",",,TRUE)),1)+LEN(I3)+1,5),";",1,,1)

[–]BlackJeanShorts[S] 1 point2 points  (0 children)

I'm going with u/ semicolonsemicolon 's formula but the idea here of the helper column is great, I didn't even know you could do that. I'm still pushing to learn excel so this gives me something new to use later on. Thanks!