Lowercases text, trims it, removes punctuation, and collapses whitespace
=LET(
t, LOWER(TRIM(TO_TEXT(text))),
TRIM(REGEXREPLACE(REGEXREPLACE(t, "[^0-9a-z]+", " "), "\s+", " "))
)This function standardizes a text value into a consistent format by converting it to lowercase, removing punctuation/symbols, and collapsing repeated whitespace into single spaces. It's useful for reliable comparisons, deduping, grouping, and fuzzy matching across messy inputs with inconsistent casing or formatting. For example, if A2 contains " Hello, WORLD!!! " then =NORMALIZE_TEXT(A2) returns "hello world".
Use the inputs below to create NORMALIZE_TEXT as a reusable custom function in Google Sheets.
Learn how to add custom functions to Google SheetsNORMALIZE_TEXT
Lowercases text, trims it, removes punctuation, and collapses whitespace
=LET( t, LOWER(TRIM(TO_TEXT(text))), TRIM(REGEXREPLACE(REGEXREPLACE(t, "[^0-9a-z]+", " "), "\s+", " ")) )
text
Text value to normalize
A2
Other functions in the same category: Text Manipulation & Formatting
Normalize whitespace without altering punctuation or letter casing
Returns the nth word from a text string
Returns the nth word from the end of a text string
Returns the text after a given character or string
Returns the text before a given character or string
Return uppercase initials from a name or phrase
Named functions enable the creation of custom, reusable formulas that mimic built-in functions, streamlining calculations and data manipulations. These functions simplify complex formulas, making spreadsheets more readable and less prone to errors. By encapsulating intricate logic within a single function call, they enhance consistency across your data. Utilizing named functions reduces the need to write lengthy formulas repeatedly, thereby improving workflow efficiency and productivity in data analysis and management.
Download and import — fastest way to add the function but does not include argument descriptions and examples
Follow these simple steps to download and import a function into your spreadsheet. This method is the quickest and easiest way to add the named function to your Google Sheets document, but will not include the argument description and examples.
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.
Copy and paste — copy and paste each property one at a time
Follow these simple steps to integrate a custom named function into your spreadsheet:
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.