Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fuzzy match on google sheets

I'm trying to fuzzy match two columns in google sheets, i've tried numerous formulas but I think it's going to come down to a script to help out.

I have a column with product ID's e.g.

  • E20067

and then I have another sheet with another column which has image url's relating to this product code such as

  • http://wholesale.test.com/product/E20067/web_images/E20067.jpg
  • http://wholesale.test.com/product/E20067/high_res/E20067.jpg
  • http://wholesale.test.com/product/E20067/high_res/E20067-2.jpg

What I'm wanting to do is "fuzzy" match both of these columns for their product ID, and then create a new column for each match. So it would have the product ID then on the same row in multiple columns each product image URL - like the image below:

enter image description here

Is there a way to do this in google sheets using a script or a formula?

like image 839
JMKelley Avatar asked Oct 27 '25 14:10

JMKelley


2 Answers

In Google sheets there are a few powerful 'regex' formulas.

Suppose, you have ID list in column A, and URL list in column B

enter image description here

Then use formula:

=REGEXEXTRACT(B1,JOIN("|",$A$1:$A$3))

It will match one of ID's. Drag the formula down to see the result as in picture above.

See more info here

like image 143
Max Makhrov Avatar answered Oct 30 '25 06:10

Max Makhrov


Old thread but, in case you find yourself here, search for my Google Sheets add-on called Flookup. It should do exactly what you want.

For this case, you can use this function:

FLOOKUP (lookup_value, table_array, lookup_col, index_num, threshold, [rank])

The parameter details are:

  1. lookup_value: the value you're looking up
  2. table_array: the table you want to search
  3. lookup_col: the column you want to search
  4. index_num: the column you want data to be returned from
  5. threshold: the percentage similarity below which data should not be returned
  6. rank: the nth best match (i.e. if the first one isn't to your liking)
  • You can find out more at the official website (examples and such).

Please note that, whereas the OP appears to want the whole list of possible matches, Flookup will only return one result at a time.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!