user2240778
user2240778

Reputation: 309

How to use Find a string from a column and then use that to vlookup - Google Sheets

I have a column with strings COL A (image names), I have a column of URLs COL B and I have a column of strings (SKU) COL C that I want to look up. The image names have a url associated to it. The SKUs are not in any particular order.

As follows

A (Image names)              |B (URL)      |C (SKU)
-----------------------------|-------------|--------
ABC0001.jpg                  |test.com/123 |XYZ0105
Walk in the park XYZ0105.jpg |test.com/456 |RST0245
Over-the-moon-RST0245.jpg .  |test.com/567 |ABC0001

All the images names have the SKU in it, but in some format or the other.

How do I use the SKU in Col C to find the SKU within the image name and lookup the URL against the image name?

So in the above example the URL for SKU ABC0001 would be test.com/123

Any help would be appreciated.

Upvotes: 0

Views: 79

Answers (1)

Ed Nelson
Ed Nelson

Reputation: 10259

I put your sample data in a sheet named List. You don't need SKU. Then on another sheet enter the SKU to search for in A2 and enter this query in B2.

=query(List!A2:B,"Select B where A contains '"& A2 &"'")

The URL will be returned.

Upvotes: 2

Related Questions