Excel functions

Text functions

Text functions work on words, codes and labels. Use them to clean imported data (TRIM, CLEAN, SUBSTITUTE), take pieces out of a string (LEFT, MID, TEXTBEFORE, REGEXEXTRACT), join lists (TEXTJOIN, CONCAT) and turn numbers and dates into nicely formatted text (TEXT).

Start with these

CONCATJoins text from several cells, ranges or values into one string. Unlike CONCATENATE it accepts whole ranges like A2:D2.FINDReturns the position of one piece of text inside another, counting from the left. Case-sensitive and without wildcards.LEFTReturns a set number of characters from the start of a text string, e.g. the first 3 letters of a product code.LENCounts the characters in a text string, including spaces, punctuation and invisible characters.LOWERConverts all letters in a text string to lowercase. Numbers and punctuation are unchanged.MIDReturns a given number of characters from the middle of a text, starting at any position you choose.PROPERCapitalises the first letter of every word and makes all other letters lowercase, e.g. "aNA sILVA" becomes "Ana Silva".REGEXEXTRACTPulls text that matches a regular expression pattern out of a string: the first match, all matches, or the capture groups.REGEXREPLACEReplaces text that matches a regular expression with new text, with support for capture-group references like $1.REGEXTESTChecks whether text matches a regular expression pattern and returns TRUE or FALSE. Great for validating codes and emails.REPLACEReplaces part of a text string, chosen by position and length, with different text. Also used to insert or delete characters.RIGHTReturns a set number of characters from the end of a text string, e.g. the last 4 digits of a phone or account number.SEARCHReturns the position of one text inside another, ignoring case and allowing wildcards ( and ?).SUBSTITUTEReplaces every occurrence (or one chosen occurrence) of a specific text with new text. Case-sensitive.TEXTFormats a number or date as text using a format code such as "#,##0.00", "0%" or "dd-mmm-yyyy", e.g. for use in sentences and labels.TEXTAFTERReturns the text that comes after a delimiter, with options for the nth or last occurrence, case-insensitive matching and a not-found value.TEXTBEFOREReturns the text that comes before a delimiter, with options for the nth or last occurrence, case-insensitive matching and a fallback.TEXTJOINJoins text from ranges or values with a delimiter between each item, optionally skipping empty cells.TEXTSPLITSplits text into separate cells at the delimiters you choose, across columns, down rows, or both. The result spills.TRIMRemoves spaces at the start and end of text and reduces any run of spaces between words to a single space.UPPERConverts all letters in a text string to capitals. Digits and punctuation are unchanged.VALUEConverts text that looks like a number, percentage, date or time into a real number Excel can calculate with.

All 49 text functions

Other categories

Lookup & referenceLogicalDate & timeMath & trigStatisticalFinancialInformationDatabaseEngineeringCompatibilityWebCubeAI & Python