Three regex functions in Excel replace the tangled formulas people use to clean up messy text
The cleanup nobody schedules, stray characters, mangled phone numbers, names in the wrong order, now fits inside a single formula.
REGEXTEST, REGEXEXTRACT, and REGEXREPLACE take a written pattern instead of a stack of nested text formulas: REGEXTEST reads a cell and returns TRUE or FALSE, REGEXEXTRACT pulls the matching text out of a longer string, and REGEXREPLACE swaps what matches for something else. MakeUseOf works through three examples, validating order IDs shaped as three uppercase letters, a hyphen, and four digits, pulling four digit order numbers out of product codes with prefixes of varying length, and stripping every non-numeric character from a phone number. The functions run in Excel for Microsoft 365 and Excel for the web only; perpetual licenses such as Excel 2021 and Excel 2024 return #NAME? errors, so a file shared with those colleagues shows broken formulas. Two more cautions from the piece: results come back as text, so wrap them in VALUE() before doing math, and test a pattern on a small sample first, because regex is greedy by default.
