What Are Text Functions?
Text functions in Excel and Google Sheets let you manipulate, combine, clean, and extract text from cells. Whether you need to merge first and last names, extract a domain from an email address, remove extra spaces, or split text into multiple columns, text formulas are essential for any data cleanup or formatting task.
The most common text functions are CONCATENATE / TEXTJOIN for merging, LEFT / RIGHT / MID for extracting, TRIM for cleaning, and SUBSTITUTE / REPLACE for finding and replacing text.
How to Use This Generator
- Go to the ExcelForm tool on the homepage
- Click the Generate tab
- Describe your text manipulation in plain English — be specific about what text to extract, merge, or replace
- Select your environment (Excel, Google Sheets, or Both)
- Click Generate Formula and copy the result into your spreadsheet
Example: Text Formula Generator in Action
"Combine first name in column A and last name in column B with a space between them."
=A2&" "&B2 (or =TEXTJOIN(" ",TRUE,A2,B2))
"Extract everything before the @ symbol in the email in column A."
=LEFT(A2,FIND("@",A2)-1)
Text Function Reference
=A2&" "&B2=TEXTJOIN(", ",TRUE,A2:A10)=LEFT(A2,3) gets first 3 chars.=TRIM(A2)=SUBSTITUTE(A2,"Old","New")=PROPER(A2) capitalizes each word.=LEN(A2)=FIND("@",A2)Common Mistakes to Avoid
- Using
CONCATENATEinstead ofTEXTJOINwhen merging ranges with delimiters — TEXTJOIN is cleaner and handles blanks - Forgetting
TRIMbefore matching or comparing text — extra spaces cause VLOOKUP and IF to fail silently - Hard-coding character positions in
LEFT/RIGHTinstead of usingFIND— positions vary with data - Using
SUBSTITUTEwhen you needREPLACE— SUBSTITUTE finds text, REPLACE uses position and length
CONCATENATE vs TEXTJOIN — Which Should You Use?
CONCATENATE and the & operator simply join strings end-to-end with no separator handling. TEXTJOIN is the modern replacement: it lets you specify a delimiter, optionally ignore empty cells, and works with entire ranges in one call.
Use CONCATENATE or & only for simple two-string joins in older Excel versions (2016 and earlier). Use TEXTJOIN for merging lists, combining cells with commas or spaces, or any situation where you might have blank cells.
Google Sheets supports both, but TEXTJOIN is available and recommended.
Extracting, Cleaning, and Transforming Text
Data imported from other systems is often messy — extra spaces, inconsistent capitalization, merged fields, or unwanted characters. Text formulas are your cleanup toolkit.
Extracting: Use LEFT, RIGHT, and MID together with FIND and LEN to pull substrings dynamically. For example, to extract a file extension: =RIGHT(A2,LEN(A2)-FIND(".",A2)).
Cleaning: TRIM removes extra spaces. CLEAN removes non-printable characters. Combine them: =TRIM(CLEAN(A2)) for maximum data hygiene.
Transforming: UPPER, LOWER, and PROPER standardize case. SUBSTITUTE and REPLACE swap or remove specific text.
Splitting: In Excel 365, TEXTSPLIT(A2, ",") splits by delimiter. In Google Sheets, use SPLIT(A2, ","). In older Excel, use a combination of LEFT, FIND, MID, and LEN to manually parse delimited values.
Frequently Asked Questions
How do I combine text from multiple cells in Excel?▾
=A2&" "&B2. For merging many cells with a delimiter, use TEXTJOIN: =TEXTJOIN(", ",TRUE,A2:A10). ExcelForm's text formula generator creates the right formula based on your description.What is the difference between CONCATENATE and TEXTJOIN?▾
CONCATENATE joins text strings together without delimiters and ignores empty cells. TEXTJOIN lets you specify a delimiter (like a comma or space) and can optionally skip empty cells. TEXTJOIN is the modern replacement and is available in Excel 2019+, Excel 365, and Google Sheets.How do I extract the first name from a full name cell?▾
LEFT and FIND functions together: =LEFT(A2,FIND(" ",A2)-1). This finds the position of the space and extracts everything before it. For last names, use RIGHT, LEN, and FIND: =RIGHT(A2,LEN(A2)-FIND(" ",A2)).How do I remove extra spaces from text in Excel?▾
TRIM function: =TRIM(A2). TRIM removes all spaces from text except single spaces between words. For removing ALL spaces, use SUBSTITUTE: =SUBSTITUTE(A2," ","").How do I split text into multiple cells?▾
TEXTSPLIT: =TEXTSPLIT(A2,","). In Google Sheets, use SPLIT: =SPLIT(A2,","). For older Excel versions, use Text to Columns (Data tab) or a combination of LEFT, RIGHT, MID, FIND, and LEN.Can I change text case with a formula?▾
UPPER converts to all capitals: =UPPER(A2). LOWER converts to lowercase: =LOWER(A2). PROPER capitalizes the first letter of each word: =PROPER(A2). These work in both Excel and Google Sheets.How do I replace specific text in a cell?▾
SUBSTITUTE to replace specific text: =SUBSTITUTE(A2,"old","new"). To replace only the first occurrence, add the optional instance_num: =SUBSTITUTE(A2,"old","new",1). For pattern matching, use REGEXREPLACE in Google Sheets.