How to Do a Fuzzy Match (Fuzzy VLOOKUP) in Google Sheets
VLOOKUP and XLOOKUP only find exact matches. "Acme Corp.", "ACME Corporation" and "Acme Co" are three different keys to them, so a lookup against your customer list returns #N/A. A fuzzy match finds the closest entry instead and tells you how close it is. Google Sheets has no fuzzy lookup built in; the NearMatch add-on adds one.
Install NearMatch free Free Google Sheets™ add-on by Tiny Lever
Steps
- Put the messy values in one column (for example, company names from a form) and your clean list on another tab, with the value you want back (such as a customer ID) next to it.
- Install NearMatch (button above) and open Extensions → NearMatch.
- Choose Match two lists, pick the messy column, the clean list and the column to return.
- Click Match. Each row gets the closest match, a score from 0 to 100 and the returned value, in new columns.
- Sort by score and check the low ones by hand. High scores are usually safe; anything you would not sign off on, fix or leave blank.
As a formula
For a few cells, use the free custom function:
=NEARMATCH(A2, Customers!A:A, Customers!B:B)
returns the ID of the closest customer name, and =NEARSCORE(A2, B2) gives the similarity of two texts from 0 to 100.
Tips for better matches
- Match against a clean, de-duplicated list; run Find near-duplicates on it first.
- Keep the returned value as an ID, not a name, so later lookups are exact.
- Pick a cut-off score for your data and review everything below it.
Match on more than one column, and merge
Pick two or more columns in both lists (for example Name and City) and NearMatch matches on all of them, so two people with the same name in different cities stay apart. Pick several columns to return (ID, email, price) to merge the two lists in one step. Each result gets a Status: Exact and Strong in green, Check in yellow, No match in red.
Questions
Is fuzzy matching free?
Yes. The free plan matches up to 200 rows per run and includes the NEARMATCH and NEARSCORE formulas. Pro runs up to 50,000 rows.
Does my data leave Google?
No. NearMatch reads only the spreadsheet you open it in and matching runs inside Google.
What does the score mean?
100 is identical after ignoring case, accents, punctuation and words like Inc, LLC, Corp and The; lower scores mean more differences. Check low scores by hand.