Text formulas
Split, join, extract and clean text: names, emails, codes and messy imports. 6 answers, each checked by running it, with a live example and an exercise.
How to extract the first name from a full name in Excel
=TEXTBEFORE(A2," ")In Excel 365 use =TEXTBEFORE(A2," "). In any version, =LEFT(A2,FIND(" ",A2)-1) takes everything before the first space.
How to extract text after a character in Excel
=TEXTAFTER(A2,"@")Use =TEXTAFTER(A2,"@") in Excel 365. In any version, =MID(A2,FIND("@",A2)+1,LEN(A2)) returns everything after the character.
How to combine text from two cells in Excel
=A2&" "&B2Join them with & and put a space in quotes between: =A2&" "&B2. TEXTJOIN joins whole ranges with a separator.
How to remove extra spaces from text in Excel
=TRIM(A2)Use =TRIM(A2). It removes spaces at the start and end and turns runs of spaces between words into one.
How to capitalize the first letter of each word in Excel
=PROPER(A2)Use =PROPER(A2). It capitalizes the first letter of every word and lowercases the rest.
How to count characters in a cell in Excel
=LEN(A2)Use =LEN(A2). It counts every character, including spaces and punctuation.