VLOOKUP is great for looking up a value and returning another corresponding value. But what happens when the first match just isn’t enough. I’ve been tasked with finding a way to put return not just the first but the second, and third match.
At first, I tried to utilize helper cells but that wasn’t good enough and they wanted me to cram the whole solution into one cell formula.
Here’s how to do it. Are you Ready?
IFERROR(INDEX($G$4:$G$36,SMALL(IF($A4=$F$4:$F$36,ROW($F$4:$F$36)-ROW($F$4)+1),1)),””)&IFERROR(INDEX($G$4:$G$36,SMALL(IF($A4=$F$4:$F$36,ROW($F$4:$F$36)-ROW($F$4)+1),2)),””)&IFERROR(INDEX($G$4:$G$36,SMALL(IF($A4=$F$4:$F$36,ROW($F$4:$F$36)-ROW($F$4)+1),3)),””)
I’m sorry about that monstrosity lets break it down.
IFERROR(INDEX($G$4:$G$36,SMALL(IF($A4=$F$4:$F$36,ROW($F$4:$F$36)-ROW($F$4)+1),1)),””)
OK that looks a little better but still kind of cryptic
IF($A4=$F$4:$F$36,ROW($F$4:$F$36)-ROW($F$4)+1)
First thing, we evaluated if $A4 is in the Selection range. It looks at the entire range assigning True/False to each row depending on if there’s a match