<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Snakbacks: Google Sheets How-Tos]]></title><description><![CDATA[Snakbacks: Google Sheets How-Tos]]></description><link>https://snakbacks.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 20 Nov 2026 18:34:31 GMT</lastBuildDate><atom:link href="https://snakbacks.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Find Near-Duplicates in Google Sheets (Similar, Not Identical)]]></title><description><![CDATA[Remove duplicates, UNIQUE and COUNTIF only catch values that are exactly the same. Real lists are full of near-duplicates: "Acme Pty Ltd", "ACME Pty. Ltd"…]]></description><link>https://snakbacks.hashnode.dev/find-near-duplicates-in-google-sheets-similar-not-identical</link><guid isPermaLink="true">https://snakbacks.hashnode.dev/find-near-duplicates-in-google-sheets-similar-not-identical</guid><category><![CDATA[google sheets]]></category><category><![CDATA[spreadsheets]]></category><dc:creator><![CDATA[Snakbacks]]></dc:creator><pubDate>Fri, 20 Nov 2026 00:38:43 GMT</pubDate><content:encoded><![CDATA[<p>Remove duplicates, UNIQUE and COUNTIF only catch values that are exactly the same. Real lists are full of near-duplicates: "Acme Pty Ltd", "ACME Pty. Ltd" and "Acme Pty Limited" are one customer typed three ways, and "Initec" is probably a typo for "Initech". This page finds them in two passes: a cleaned key that makes formatting differences disappear, then a similarity score for the typos that are left. Everything is formulas, and your original data stays untouched.</p>
<h2>The sample data</h2>
<p>Row 1 holds headers. Names in A2:A8:</p>
<ul>
<li>Acme Pty Ltd</li>
<li>ACME Pty. Ltd</li>
<li>Globex Corporation</li>
<li>Initech</li>
<li>Acme Pty Limited</li>
<li>Globex Corp</li>
<li>Initec</li>
</ul>
<h2>Pass 1: a cleaned key</h2>
<p>Most near-duplicates differ only in capitals, punctuation, spacing and company suffixes. Build a key with all of that removed. In B2, filled down:</p>
<pre><code>=IF(A2="","",TRIM(REGEXREPLACE(REGEXREPLACE(LOWER(SUBSTITUTE(A2,CHAR(160)," ")),"[^a-z0-9 ]",""),"\b(pty|ltd|limited|inc|llc|corp|corporation|co|company|the)\b","")))
</code></pre>
<p>The keys are acme, acme, globex, initech, acme, globex, initec. Reading from the inside: SUBSTITUTE swaps non-breaking spaces for normal ones, LOWER removes capitals, the first REGEXREPLACE deletes everything except letters, digits and spaces, the second deletes the suffix words, and TRIM tidies the spaces left behind. Edit the word list to suit your data, and check that no real name is on it. The key also drops accented letters, so "Café" becomes "caf"; that is fine for matching, as long as both copies lose the same letters.</p>
<h2>Flag and group the exact key matches</h2>
<p>Count each key. In C2:</p>
<pre><code>=COUNTIF($B$2:$B$8,B2)&gt;1
</code></pre>
<p>TRUE marks a near-duplicate: the three Acme rows and the two Globex rows. Initech and Initec show FALSE, because their keys still differ.</p>
<p>To label each group with the first spelling seen, in D2:</p>
<pre><code>=INDEX($A$2:$A$8,MATCH(B2,$B$2:$B$8,0))
</code></pre>
<p>This gives Acme Pty Ltd for all three Acme rows, Globex Corporation for both Globex rows, and the name itself for the others. Use column D as the clean value, or as the key for any of our exact methods, such as merging rows and adding up their amounts: <a href="https://www.snakbacks.com/merge-duplicate-rows-sum-google-sheets">https://www.snakbacks.com/merge-duplicate-rows-sum-google-sheets</a></p>
<h2>Pass 2: catch typos with a similarity score</h2>
<p>Cleaning cannot fix a misspelling inside a word. For that, score each key against every other key and keep the best score. This uses the LEVENSHTEIN named function from our Levenshtein guide, which takes a minute to set up: <a href="https://www.snakbacks.com/levenshtein-distance-google-sheets">https://www.snakbacks.com/levenshtein-distance-google-sheets</a> (or get it ready-made in our free starter template: <a href="https://snakback.gumroad.com/l/levenshtein-starter">https://snakback.gumroad.com/l/levenshtein-starter</a>)</p>
<p>In E2, filled down:</p>
<pre><code>=IF(B2="","",MAX(MAP($B$2:$B$8,ARRAYFORMULA(ROW($B$2:$B$8)),LAMBDA(x,rn,IF(OR(rn=ROW(),x=""),0,1-LEVENSHTEIN(B2,x)/MAX(LEN(B2),LEN(x)))))))
</code></pre>
<p>Results: 1, 1, 1, 0.857, 1, 1, 0.857. A score of 1 means another row has the same key (Pass 1 already found those). Initech and Initec score 0.857 against each other, one letter apart. The rn=ROW() test skips the row's own key, which would always score 1. Keep the ARRAYFORMULA around ROW: without it, ROW of a range returns only the first row number, MAP gets two inputs of different sizes, and the formula returns #VALUE!. We hit exactly that in testing.</p>
<p>Turn the score into a decision in F2:</p>
<pre><code>=IF(E2="","",IF(E2=1,"duplicate",IF(E2&gt;=0.85,"check","")))
</code></pre>
<p>"check" is the useful column: likely typos, worth a look before you merge them. Do not merge them automatically. One letter is a large share of a short name, so two genuinely different short names can pass 0.85. Raise the cut-off for short keys, or always review "check" rows by eye.</p>
<h2>Remove the duplicates once you have reviewed them</h2>
<p>When columns D and F look right, make a copy of the tab and turn column D into fixed values (copy it, then Edit &gt; Paste special &gt; Values only), so deleting rows cannot change the labels. Then either:</p>
<ul>
<li>keep the first row of each group with Data &gt; Data cleanup &gt; Remove duplicates, ticking only column D, or</li>
<li>build a clean list with =UNIQUE(D2:D8), which returns Acme Pty Ltd, Globex Corporation, Initech, Initec.</li>
</ul>
<p>Fix any "check" rows by hand first (here, change Initec to Initech) and the list collapses to three.</p>
<h2>Limits</h2>
<ul>
<li>The similarity formula scores every pair, so the work grows with the square of the list. A few hundred rows is comfortable; thousands will be very slow.</li>
<li>It finds the closest other row but does not group chains of typos: if A is close to B and B is close to C, these formulas will not put all three in one group.</li>
<li>Reordered words ("Smith John" and "John Smith") score low. Sort the words inside the key if order does not matter, as shown in our names guide: <a href="https://www.snakbacks.com/match-names-with-typos-google-sheets">https://www.snakbacks.com/match-names-with-typos-google-sheets</a></li>
</ul>
<h2>When an add-on or script pack helps</h2>
<p>Disclosure: Snakbacks, the publisher of this site, sells a paid script pack and makes two free add-ons for Google Sheets.</p>
<p>The two passes above are free and fine for a few hundred rows. The Data Cleanup Kit for Google Sheets (US$15, no add-on install): <a href="https://snakback.gumroad.com/l/data-cleanup-kit">https://snakback.gumroad.com/l/data-cleanup-kit</a> does both in one function: FUZZYDUPES(range) groups near-duplicates, chains included, and labels each group, on up to 600 rows at a time. It also has ready-made tabs for merging and summing, keeping the latest row, comparing lists, splitting names and cleaning text.</p>
<p>Our free add-on Duplicate Remover is coming soon to the Google Workspace Marketplace.</p>
<p>Snakbacks publishes the Duplicate Remover and Fuzzy Match add-ons.</p>
<p><em>Originally published at <a href="https://www.snakbacks.com/find-near-duplicates-google-sheets">https://www.snakbacks.com/find-near-duplicates-google-sheets</a>. Written with AI assistance; every formula on this page was tested in a real Google Sheet.</em></p>
]]></content:encoded></item><item><title><![CDATA[Match Names with Typos in Google Sheets (Fuzzy Name Matching)]]></title><description><![CDATA[Names that should match but do not are a daily Sheets problem: "Smith, John" against "John Smith", "Jon" against "John", "Dr. J. Smith" against "John…]]></description><link>https://snakbacks.hashnode.dev/match-names-with-typos-in-google-sheets-fuzzy-name-matching</link><guid isPermaLink="true">https://snakbacks.hashnode.dev/match-names-with-typos-in-google-sheets-fuzzy-name-matching</guid><category><![CDATA[google sheets]]></category><category><![CDATA[spreadsheets]]></category><dc:creator><![CDATA[Snakbacks]]></dc:creator><pubDate>Thu, 19 Nov 2026 04:41:55 GMT</pubDate><content:encoded><![CDATA[<p>Names that should match but do not are a daily Sheets problem: "Smith, John" against "John Smith", "Jon" against "John", "Dr. J. Smith" against "John Smith". Standard lookups need an exact match. This page starts with cleaning, which fixes most cases, then moves to similarity scores for what is left.</p>
<h2>The sample data</h2>
<p>Names A2:A4: Smith, John / JOHN SMITH / Jon Smith. The master list is John Smith, in D2, with ID 101 in E2. Row 1 holds headers.</p>
<h2>Step 1: clean the obvious differences</h2>
<p>Most "typos" are formatting. Fix those first and a normal lookup works.</p>
<h3>Flip "Last, First"</h3>
<pre><code class="language-plaintext">=IF(ISNUMBER(SEARCH(",",A2)),TRIM(REGEXREPLACE(A2,"^\s*([^,]+),\s*(.+)$","$2 $1")),TRIM(A2))
</code></pre>
<p>"Smith, John" becomes "John Smith". Names without a comma are only trimmed.</p>
<h3>Strip titles and suffixes</h3>
<pre><code class="language-plaintext">=TRIM(REGEXREPLACE(A2,"(?i)\b(mr|mrs|ms|miss|dr|jr|sr)\b\.?",""))
</code></pre>
<p>"Dr. John Smith Jr" becomes "John Smith". Check your data first: a surname that is also a title word will be removed too.</p>
<h3>Ignore case, spacing, punctuation and word order</h3>
<p>This builds a key by removing punctuation, lowercasing, splitting into words and sorting them:</p>
<pre><code class="language-plaintext">=IF(A2="","",TEXTJOIN(" ",TRUE,SORT(TRANSPOSE(SPLIT(LOWER(TRIM(REGEXREPLACE(A2,"[^\w\s]","")))," ")))))
</code></pre>
<p>"Smith, John", "John Smith" and "JOHN SMITH" all become "john smith". Build the same key for your master list in column F, then look up, where G2 holds the key for the messy name:</p>
<pre><code class="language-plaintext">=IFERROR(INDEX($E$2:$E$100,MATCH(G2,$F$2:$F$100,0)),"")
</code></pre>
<p>The first two sample names return 101. "Jon Smith" returns blank, because the spelling differs inside a word. That is what the next steps are for. Removing punctuation turns O'Brien into OBrien, on both sides, so it still matches itself.</p>
<h2>Step 2: a looser key for "Jon" versus "John"</h2>
<p>Cleaning cannot fix a spelling difference inside a word. A common compromise is a key of first initial plus last word:</p>
<pre><code class="language-plaintext">=IF(A2="","",LOWER(LEFT(TRIM(A2),1)&amp;" "&amp;REGEXEXTRACT(TRIM(A2),"\S+$")))
</code></pre>
<p>"Jon Smith", "John Smith" and "J. Smith" all become "j smith". The catch is false positives: John Smith and Jane Smith get the same key. Flip "Last, First" names first, otherwise "Smith, John" gives "s john". Use this key to build a shortlist, then check the pairs by eye.</p>
<h2>Step 3: score-based matching</h2>
<p>When the cleaning approaches are not enough, you need a similarity score, a number from 0 to 1 for how close two strings are. Google Sheets has no built-in function for it. You can build one from formulas alone with LAMBDA, as our Levenshtein guide shows: <a href="https://www.snakbacks.com/levenshtein-distance-google-sheets">https://www.snakbacks.com/levenshtein-distance-google-sheets</a> or get that formula ready-made in our free starter template: <a href="https://snakback.gumroad.com/l/levenshtein-starter">https://snakback.gumroad.com/l/levenshtein-starter</a></p>
<p>Another free option is a small Apps Script function (Extensions &gt; Apps Script) that scores a pair using Levenshtein distance, the number of single-character edits between two strings:</p>
<pre><code class="language-plaintext">function NAMESCORE(a, b) {
  a = String(a).toLowerCase().trim();
  b = String(b).toLowerCase().trim();
  if (!a &amp;&amp; !b) return 1;
  var m = a.length, n = b.length, prev = [], cur, i, j;
  for (j = 0; j &lt;= n; j++) prev[j] = j;
  for (i = 1; i &lt;= m; i++) {
    cur = [i];
    for (j = 1; j &lt;= n; j++) {
      cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1,
        prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
    }
    prev = cur;
  }
  return 1 - prev[n] / Math.max(m, n);
}
</code></pre>
<p>Then use =NAMESCORE(A4, $D$2). "Jon Smith" against "John Smith" is one edit over 10 characters, so 0.9. This scores one pair at a time. To find the best match in a list you would need a grid of scores, or a longer script that loops over the list.</p>
<p>Two cautions before you trust a cut-off such as 0.85:</p>
<ul>
<li>Short names cross it too easily, because the score divides one edit by the length. "Ann Lee" against "Ann Lea" scores 0.857 and "Jon Smith" against "Jan Smith" scores 0.889, yet both are different people. Make the cut-off stricter for short names, or send anything that scores below 1 to a "check by eye" column instead of accepting it automatically.</li>
<li>Score the cleaned key from Step 1, not the raw cell. Raw "Smith, John" against "John Smith" scores only 0.09, although the sorted key already shows they are the same name. =NAMESCORE(G4, $F$2) on the key columns gives 1.</li>
</ul>
<p>(Thanks to a reader on our Hashnode blog for pointing out both of these.)</p>
<h2>Limits</h2>
<p>No method here understands that "Bob" and "Robert" are the same person. For nicknames, keep a small lookup table of nickname and full name and replace first. Names in different scripts or with accents also need preparing first.</p>
<h2>When an add-on or script pack helps</h2>
<p>Disclosure: Snakbacks, the publisher of this site, sells a paid script pack and makes two free add-ons for Google Sheets.</p>
<p>Fuzzy Match Template for Google Sheets (US$9, no add-on install): <a href="https://snakback.gumroad.com/l/fuzzy-formulas">https://snakback.gumroad.com/l/fuzzy-formulas</a>. It gives you FUZZYSCORE(a, b) for the 0 to 1 score, FUZZYMATCH(values, lookup, [threshold]) to return the closest name from a clean list, and FUZZYLOOKUP to fetch an ID alongside it, each accepting a whole column. You paste the functions in once, or copy a template sheet, so it works where a Workspace admin blocks add-ons, and you own the code. There is a 30-day refund if it does not work for you. If the cleaning steps above fix your data, you do not need it.</p>
<p>Our free add-ons Fuzzy Match and Duplicate Remover are coming soon to the Google Workspace Marketplace.</p>
<p>Snakbacks publishes the Duplicate Remover and Fuzzy Match add-ons.</p>
<hr />
<p><em>Originally published at</em> <a href="https://www.snakbacks.com/match-names-with-typos-google-sheets"><em>https://www.snakbacks.com/match-names-with-typos-google-sheets</em></a><em>. Written with AI assistance; every formula on this page was tested in a real Google Sheet.</em></p>
]]></content:encoded></item><item><title><![CDATA[Compare Two Sheets in Google Sheets (Find Differences)]]></title><description><![CDATA[To compare two sheets in Google Sheets you have two different jobs. One is a cell-by-cell comparison of two tabs with the same layout. The other is…]]></description><link>https://snakbacks.hashnode.dev/compare-two-sheets-in-google-sheets-find-differences</link><guid isPermaLink="true">https://snakbacks.hashnode.dev/compare-two-sheets-in-google-sheets-find-differences</guid><category><![CDATA[google sheets]]></category><category><![CDATA[spreadsheets]]></category><dc:creator><![CDATA[Snakbacks]]></dc:creator><pubDate>Thu, 19 Nov 2026 04:40:30 GMT</pubDate><content:encoded><![CDATA[<p>To compare two sheets in Google Sheets you have two different jobs. One is a cell-by-cell comparison of two tabs with the same layout. The other is matching rows by a key, to find rows in Sheet1 that are not in Sheet2. This page covers both with formulas, plus a highlighting rule that works across tabs.</p>
<h2>The sample data</h2>
<p>Sheet1 A1:B5 (Item, Qty): Apple 5; Banana 3; Cherry 7; Date 2.</p>
<p>Sheet2 A1:B5 (Item, Qty): Apple 5; Banana 4; Cherry 7; Dates 2.</p>
<p>Two things differ: Banana has quantity 3 on one sheet and 4 on the other, and "Date" is spelled "Dates" on Sheet2. Add a third tab called Diff for the results.</p>
<h2>Method 1: cell-by-cell differences on a third sheet</h2>
<p>In Diff!A1, one formula fills the whole grid:</p>
<pre><code class="language-plaintext">=ARRAYFORMULA(IF(Sheet1!A1:B5=Sheet2!A1:B5,"",Sheet1!A1:B5&amp;" -&gt; "&amp;Sheet2!A1:B5))
</code></pre>
<p>Result: every cell is blank except Diff!B3 ("3 -&gt; 4") and Diff!A5 ("Date -&gt; Dates"). A blank cell means the two sheets agree. Both ranges must be the same size, so use the same corner and the same number of rows and columns.</p>
<p>The = comparison ignores case, so "apple" equals "Apple". For a case-sensitive version use EXACT:</p>
<pre><code class="language-plaintext">=ARRAYFORMULA(IF(EXACT(Sheet1!A1:B5,Sheet2!A1:B5),"",Sheet1!A1:B5&amp;" -&gt; "&amp;Sheet2!A1:B5))
</code></pre>
<p>To count the differences:</p>
<pre><code class="language-plaintext">=SUMPRODUCT(--(Sheet1!A1:B5&lt;&gt;Sheet2!A1:B5))
</code></pre>
<p>Result: 2.</p>
<p>This only works when row 3 on one sheet is meant to be row 3 on the other. If the rows are in a different order, or one sheet has an extra row, every row after it will differ. In that case, match by key instead.</p>
<h2>Method 2: match rows by key with COUNTIF or MATCH</h2>
<p>In Sheet1!C2, fill down:</p>
<pre><code class="language-plaintext">=IF(A2="","",IF(COUNTIF(Sheet2!$A$2:$A$100,A2)=0,"Missing in Sheet2","Found"))
</code></pre>
<p>Result for C2:C5: Found, Found, Found, Missing in Sheet2. "Date" is flagged because Sheet2 only has "Dates". COUNTIF matches the whole cell, not part of it.</p>
<p>The same with MATCH:</p>
<pre><code class="language-plaintext">=IF(A2="","",IF(ISNA(MATCH(A2,Sheet2!$A$2:$A$100,0)),"Missing in Sheet2","Found"))
</code></pre>
<p>The result is identical. MATCH is handy when you also want the position.</p>
<p>To go one step further and compare the quantity of the matched row, in D2:</p>
<pre><code class="language-plaintext">=IF(A2="","",IFERROR(IF(INDEX(Sheet2!$B$2:$B$100,MATCH(A2,Sheet2!$A$2:$A$100,0))=B2,"Same","Different"),"Missing in Sheet2"))
</code></pre>
<p>Result for D2:D5: Same, Different, Same, Missing in Sheet2.</p>
<p>To find rows in Sheet2 that are missing from Sheet1, put the mirror formula on Sheet2 with the sheet names swapped.</p>
<h2>Method 3: FILTER the rows missing from the other sheet</h2>
<p>This lists the rows themselves, with no helper column. In Diff!A1:</p>
<pre><code class="language-plaintext">=FILTER(Sheet1!A2:B100,Sheet1!A2:A100&lt;&gt;"",COUNTIF(Sheet2!A2:A100,Sheet1!A2:A100)=0)
</code></pre>
<p>Result: one row, Date 2. For the other direction, swap the sheets:</p>
<pre><code class="language-plaintext">=FILTER(Sheet2!A2:B100,Sheet2!A2:A100&lt;&gt;"",COUNTIF(Sheet1!A2:A100,Sheet2!A2:A100)=0)
</code></pre>
<p>Result: Dates 2. If nothing is missing, FILTER shows an error saying no matches, so wrap it in IFERROR(...,"Nothing missing") if you want a clean message.</p>
<p>To list rows where the whole row (Item and Qty) has no exact twin, use COUNTIFS on both columns:</p>
<pre><code class="language-plaintext">=FILTER(Sheet1!A2:B100,Sheet1!A2:A100&lt;&gt;"",COUNTIFS(Sheet2!A2:A100,Sheet1!A2:A100,Sheet2!B2:B100,Sheet1!B2:B100)=0)
</code></pre>
<p>Result: Banana 3 and Date 2. Banana's row has no twin because its quantity differs.</p>
<h2>Method 4: highlight differences with conditional formatting and INDIRECT</h2>
<p>A conditional formatting rule cannot point straight at another sheet. INDIRECT turns text into a reference and gets around that. Select Sheet1!A2:A100, open Format &gt; Conditional formatting, choose "Custom formula is", and use:</p>
<pre><code class="language-plaintext">=AND($A2&lt;&gt;"",COUNTIF(INDIRECT("Sheet2!$A$2:$A$100"),$A2)=0)
</code></pre>
<p>Result: A5 (Date) is highlighted. If the tab name has spaces, use INDIRECT("'Old List'!$A$2:$A$100").</p>
<p>For a cell-by-cell highlight, select Sheet1!A2:B100 and use:</p>
<pre><code class="language-plaintext">=A2&lt;&gt;INDIRECT("Sheet2!"&amp;ADDRESS(ROW(),COLUMN(),4))
</code></pre>
<p>Result: B3 (3 against 4) and A5 (Date against Dates) are highlighted. ADDRESS with the 4 builds a plain reference such as "B3", so each cell is compared with the same cell on Sheet2.</p>
<h2>Why a comparison looks wrong</h2>
<ul>
<li>Extra spaces. "Banana" and "Banana " differ. Use Data &gt; Data cleanup &gt; Trim whitespace on both sheets first.</li>
<li>Numbers stored as text. "5" typed as text does not equal the number 5.</li>
<li>Different sized ranges in Method 1 cause an error.</li>
<li>Sorted differently. Use Methods 2 and 3, which look rows up by key, rather than Method 1.</li>
<li>Spelling differences. "Date" and "Dates" are simply different strings, and none of the formulas above treat them as the same item.</li>
</ul>
<h2>When an add-on or script pack helps</h2>
<p>Disclosure: Snakbacks, the publisher of this site, sells a paid script pack and makes two free add-ons for Google Sheets.</p>
<p>Methods 2 and 3 only match keys that are exactly the same. If the two sheets come from different systems, with "Date" on one and "Dates", "Dte" or "date " on the other, you will see a lot of false "missing" rows. Fuzzy Match Template for Google Sheets (US$9, no add-on install): <a href="https://snakback.gumroad.com/l/fuzzy-formulas">https://snakback.gumroad.com/l/fuzzy-formulas</a>. It adds FUZZYLOOKUP(values, lookup, return_range, [threshold]), a fuzzy XLOOKUP, and FUZZYMATCH and FUZZYSCORE, so near-matches can be paired instead of flagged as missing. You paste the functions into your sheet once, so it works where a Workspace admin blocks add-ons. There is a 30-day refund if it does not work for you. If both sheets use the same clean IDs, the free formulas above are enough.</p>
<p>Fuzzy Match, our free add-on, is coming soon to the Google Workspace Marketplace.</p>
<p>Snakbacks publishes the Duplicate Remover and Fuzzy Match add-ons.</p>
<hr />
<p><em>Originally published at</em> <a href="https://www.snakbacks.com/compare-two-sheets-google-sheets"><em>https://www.snakbacks.com/compare-two-sheets-google-sheets</em></a><em>. Written with AI assistance; every formula on this page was tested in a real Google Sheet.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to Fuzzy Match in Google Sheets (3 Ways)]]></title><description><![CDATA[Google Sheets has no built-in fuzzy match. VLOOKUP, MATCH and XLOOKUP only find text that is identical, so "Inytech" will never find "Initech", and "ACME…]]></description><link>https://snakbacks.hashnode.dev/how-to-fuzzy-match-in-google-sheets-3-ways</link><guid isPermaLink="true">https://snakbacks.hashnode.dev/how-to-fuzzy-match-in-google-sheets-3-ways</guid><category><![CDATA[google sheets]]></category><category><![CDATA[spreadsheets]]></category><dc:creator><![CDATA[Snakbacks]]></dc:creator><pubDate>Thu, 19 Nov 2026 04:38:59 GMT</pubDate><content:encoded><![CDATA[<p>Google Sheets has no built-in fuzzy match. VLOOKUP, MATCH and XLOOKUP only find text that is identical, so "Inytech" will never find "Initech", and "ACME Pty. Ltd" will never find "Acme Pty Ltd". This page shows three ways to fix that, starting with the ones that need no add-on.</p>
<h2>The problem in one example</h2>
<p>You have a clean master list of customers with IDs, and a messy list from another system. You want the ID next to every messy name.</p>
<p>Master list (columns D and E):</p>
<ul>
<li>Initech, 101</li>
<li>Umbrella Corp, 102</li>
<li>Acme Pty Ltd, 103</li>
<li>Globex Corporation, 104</li>
</ul>
<p>Messy names (column A, starting at A2):</p>
<ul>
<li>ACME Pty. Ltd</li>
<li>Inytech</li>
<li>Corp Umbrella</li>
<li>Globex</li>
</ul>
<p>A normal VLOOKUP returns #N/A for all four. Each one fails for a different reason: punctuation, a typo, word order and a shortened name. No single trick fixes all four, which is why there are three methods below.</p>
<h2>Method 1: clean both sides, then look up (no add-on)</h2>
<p>This handles case, extra spaces and punctuation. It does not handle typos or word order.</p>
<p>In F2 on the master list, build a clean key and fill it down:</p>
<pre><code class="language-plaintext">=LOWER(TRIM(REGEXREPLACE(D2,"[^\w\s]","")))
</code></pre>
<p>Then in B2, clean the messy name the same way and look it up against the key column:</p>
<pre><code class="language-plaintext">=IFERROR(INDEX($E$2:$E$100, MATCH(LOWER(TRIM(REGEXREPLACE(A2,"[^\w\s]",""))), $F$2:$F$100, 0)), "")
</code></pre>
<p>"ACME Pty. Ltd" becomes "acme pty ltd", which matches the key for Acme Pty Ltd, so you get 103. The other three rows return blank, because they are not just a formatting difference.</p>
<p>If your spreadsheet uses a comma as the decimal mark, Sheets may want semicolons between arguments instead of commas.</p>
<h2>Method 2: wildcards and word overlap (no add-on)</h2>
<p>Use this when one name is a shortened version of the other.</p>
<h3>Wildcard match</h3>
<pre><code class="language-plaintext">=IFERROR(INDEX($E$2:$E$100, MATCH("*"&amp;A2&amp;"*", $D$2:$D$100, 0)), "")
</code></pre>
<p>The asterisks mean "anything before or after". "Globex" is found inside "Globex Corporation", so you get 104. This only works when your messy text is contained in the master name, in the same word order.</p>
<h3>Word overlap, for different word order</h3>
<p>Put the messy name in G1, for example "Corp Umbrella". Next to each master name, in H2, count how many of its words appear in the candidate, and fill down:</p>
<pre><code class="language-plaintext">=SUMPRODUCT(--ISNUMBER(SEARCH(SPLIT(LOWER(REGEXREPLACE(TRIM($G$1),"[^\w\s]",""))," "),LOWER(D2))))
</code></pre>
<p>Then pick the highest score:</p>
<pre><code class="language-plaintext">=IF(MAX(H2:H100)=0,"",INDEX(D2:D100,MATCH(MAX(H2:H100),H2:H100,0)))
</code></pre>
<p>"Corp Umbrella" scores 2 against Umbrella Corp, 1 against Globex Corporation and 0 against the rest, so it returns Umbrella Corp.</p>
<p>Limits: it matches word fragments (the word "corp" is found inside "Corporation", which is why that row scores 1), and a single typo inside a word scores zero. Check the best match by eye, and only trust it when the winner clearly beats the runner-up.</p>
<h2>Method 3: typo-tolerant matching</h2>
<p>To catch "Inytech" you need an edit-distance measure, which counts how many single-letter changes turn one string into another. Sheets does not have one, so you add it yourself.</p>
<h3>Option A: a small Apps Script function (free)</h3>
<p>Open Extensions &gt; Apps Script, paste this, and save:</p>
<pre><code class="language-plaintext">function CLOSEST_MATCH(value, list, minScore) {
  var target = norm_(value);
  var min = (minScore === undefined || minScore === "") ? 0.8 : minScore;
  var items = [].concat.apply([], list);
  var best = "", bestScore = 0;
  for (var i = 0; i &lt; items.length; i++) {
    var cand = norm_(items[i]);
    if (!cand) continue;
    var score = 1 - lev_(target, cand) / Math.max(target.length, cand.length);
    if (score &gt; bestScore) { bestScore = score; best = items[i]; }
  }
  return bestScore &gt;= min ? best : "";
}
function norm_(s) {
  return String(s).toLowerCase().replace(/[^\w\s]/g, "").replace(/\s+/g, " ").trim();
}
function lev_(a, b) {
  var prev = [], i, j;
  for (j = 0; j &lt;= b.length; j++) prev[j] = j;
  for (i = 1; i &lt;= a.length; i++) {
    var cur = [i];
    for (j = 1; j &lt;= b.length; j++) {
      var cost = a.charAt(i - 1) === b.charAt(j - 1) ? 0 : 1;
      cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + cost);
    }
    prev = cur;
  }
  return prev[b.length];
}
</code></pre>
<p>Use it in a cell, one row at a time, and fill down:</p>
<pre><code class="language-plaintext">=CLOSEST_MATCH(A2, $D$2:$D$100, 0.8)
</code></pre>
<p>"Inytech" returns Initech. "Corp Umbrella" still returns blank, because the letters are in a different order. Custom functions are slow on thousands of rows, since each cell scans the whole list.</p>
<h3>Option B: the Fuzzy Match add-on (free)</h3>
<p>Disclosure: Snakbacks, the publisher of this site, makes a free add-on called Fuzzy Match: Fuzzy VLOOKUP for Sheets. It adds three formulas that tolerate typos, case, punctuation and word order, and each accepts a whole column:</p>
<pre><code class="language-plaintext">=FUZZYMATCH(A2:A100, Customers!A2:A, 0.8)
=FUZZYLOOKUP(A2:A100, Customers!A2:A, Customers!C2:C, 0.8)
=FUZZYSCORE(A2, B2)
</code></pre>
<p>FUZZYMATCH returns the closest value from your clean list. FUZZYLOOKUP is like XLOOKUP but fuzzy: it finds the closest row and returns any column from it, such as an ID. FUZZYSCORE returns a similarity from 0 to 1. Everything runs inside your sheet.</p>
<p>It is coming soon to the Google Workspace Marketplace.</p>
<p>If you cannot install add-ons, or prefer to own the code: Fuzzy Match Template for Google Sheets (US$9, no add-on install): <a href="https://snakback.gumroad.com/l/fuzzy-formulas">https://snakback.gumroad.com/l/fuzzy-formulas</a>. It is the same three formulas as Apps Script you paste in once, or get by copying a template sheet. Snakbacks sells this pack.</p>
<h2>Which method should you pick?</h2>
<ul>
<li>Only case, spaces or punctuation differ: Method 1. Quick and exact.</li>
<li>Names are shortened versions of each other: Method 2, wildcard.</li>
<li>Word order differs: Method 2 word overlap, or the add-on.</li>
<li>Typos: Method 3, either option.</li>
<li>Thousands of rows, repeated often: the add-on, since the formulas fill a whole column in one go.</li>
</ul>
<h2>Choosing a threshold</h2>
<p>Fuzzy matching returns a score from 0 (nothing alike) to 1 (identical). You decide the cut-off:</p>
<ul>
<li>0.9: strict. Very few wrong matches, but you will miss some real ones.</li>
<li>0.8: a sensible default.</li>
<li>0.7: loose. Catches more, and also produces more wrong matches.</li>
</ul>
<p>Start at 0.8, then sort the matches by score and read the lowest few by eye. If they look wrong, raise the threshold. If real matches are being left blank, lower it. A blank cell is better than a confident wrong answer.</p>
<h2>FAQ</h2>
<h3>Does XLOOKUP help?</h3>
<p>Google Sheets has XLOOKUP, but it is an exact-match function. It will not forgive typos unless you pair it with a cleaned key column as in Method 1.</p>
<h3>Is my data safe?</h3>
<p>Methods 1 and 2 are plain formulas. The Apps Script runs under your own account. The Fuzzy Match add-on works inside the spreadsheet you open it in.</p>
<h3>How big a list can I use?</h3>
<p>Plain formulas handle thousands of rows comfortably. The Apps Script version slows down because each row is compared with every master row.</p>
<p>Snakbacks publishes the Duplicate Remover and Fuzzy Match add-ons.</p>
<hr />
<p><em>Originally published at</em> <a href="https://www.snakbacks.com/fuzzy-match-google-sheets"><em>https://www.snakbacks.com/fuzzy-match-google-sheets</em></a><em>. Written with AI assistance; every formula on this page was tested in a real Google Sheet.</em></p>
]]></content:encoded></item></channel></rss>