Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 905

VLOOKUP where part of lookup-cell can be contained in lookup table

$
0
0

Most of the time, I use wildcards in VLOOKUP to get a match when my lookup table contains longer descriptions of which a part might match my lookup value.

I now have the opposite usecase; I have a table containing bank transactions, and want to add a column to that table with what category the transaction falls in. For common payments, I created a second table with general keywords linking to categories, so I don't have to fill them in manually. As such, my main table - in the last column of which my vlookup will find place - looks as follows:

enter image description here

And my lookup table might look as follows:

enter image description here

How can I now structure my VLOOKUP in the "Category" will find the appropriate value in the lookup-table based on just part of the string it's looking up?

i.e., if my main table contains the value "abc KEYWORD def" and my lookup table contains the key "KEYWORD", I want the lookup call to match it with the value it finds for "KEYWORD".

I tried to use the whole wildcard thing somewhat like this =VLOOKUP("*"&LookupCell&"*", LookupTable, 2, FALSE), but afaik that works the exact opposite way of what I want to do, by checking if my lookup table might contain a key looking like "otherstuff abc KEYWORD def otherstuff".


Viewing all articles
Browse latest Browse all 905

Trending Articles