Compare Text and Similarity in Google Sheets
Comparing text helps you find exact matches, near duplicates and inconsistent values. Google Sheets can compare values exactly with formulas, and Apps Script or specialised functions can help when you need similarity scores for review.
Exact comparisons
Use =A2=B2, EXACT, COUNTIF or lookup formulas to check whether values are identical. Normalise case, spacing and punctuation before comparing if formatting differences are not meaningful.
Compare with Apps Script
Apps Script can standardise values and label rows for review. For simple similarity, you can compare normalised strings or implement a scoring approach that fits your data.
function compareTextColumns() {
var sheet = SpreadsheetApp.getActiveSheet();
var values = sheet.getRange("A2:B").getValues();
var out = values.map(function (r) {
var a = String(r[0] || "").trim().toLowerCase();
var b = String(r[1] || "").trim().toLowerCase();
if (!a && !b) return ["", ""];
if (a === b) return ["Exact", 1];
return [a && b ? "Review" : "Missing", a && b ? "" : 0];
});
sheet.getRange(2, 3, out.length, 2).setValues(out);
}
For production use, add the comparison logic you need and review borderline cases instead of assuming a match.
Similarity scoring with Flookup FUZZYSIM
Flookup's FUZZYSIM custom function compares two text values and returns a similarity score, which is useful for fuzzy matching and near-duplicate review. See custom functions for syntax and examples. You can also ask the Sheets AI Assistant for a formula that compares your ranges and returns scores or statuses.