I'm trying to use VLOOKUP to match activities with product codes, but run into an issue since VLOOKUP always returns the first match. I did a mockup below to describe my issue. To the left, I have a table with activity names and product codes.
To the right, in column G, I want to, based on matching activity names in column F with activity names in column A, assign the activities product codes from column B.
When I use VLOOKUP, it only matches with the first activity name and give all the activities with the same name the same product codes. I need them to get different product codes even if they have the same name. I want my function to "take the next one" on the list, when the first one is taken.
Should I try to use another function to solve this? Is it impossible with VLOOKUP? My 'real' document has like 2000 rows, and the solutions I found on Youtube was not good to scale.
Thanks in advance. I'm new to here so if I should clarify my question in any way, feel free to tell me.
F
? This is a case for aPivot Table
. Or ifVBA
is allowed, I would give it a shot but I need to know the table name and/or if this is the only table on the worksheet, and if the data in columnsA
andB
is values or formulas. IfVBA
is not allowed, feel free to ignore the request. I suppose the data in columnA
is not sorted in your real worksheet. – VBasic2008