Skip to main content

Text formula page

Combine Cells Formula

Use TEXTJOIN when names, labels, or address pieces should combine with a separator.

Best for

Combine cells in Excel or Google Sheets.

What it returns

The formula joins nonblank cells from A2:C2 with spaces.

Copy formulas

Excel formula
=TEXTJOIN(" ", TRUE, A2:C2)
Google Sheets formula
=TEXTJOIN(" ", TRUE, A2:C2)
Excel / Google Sheets difference

Excel and Google Sheets use the same TEXTJOIN syntax. TRUE skips empty cells, while FALSE preserves every cell position and can create repeated separators.

Example data

Raw TextExample Result
Maya ChenMaya
SKU-1001-EastSKU
https://www.example.com/pricingexample.com
Acme North Acme North
What it returns

The formula joins nonblank cells from A2:C2 with spaces.

How the formula works

  • The first argument is the separator.
  • TRUE skips blank cells.
  • A2:C2 is the range to combine.
Syntax pieceRole in the formula
" "The separator inserted between included cell values.
TRUEThe ignore-empty setting that skips blank cells.
A2:C2The source range whose values are combined in order.

Verified examples

Skip blank name part
=TEXTJOIN(" ", TRUE, A2:C2)

Excel: Enter Maya in A2, Chen in B2, and leave C2 blank. Returns: Maya Chen

Comma-separated row
=TEXTJOIN(", ",TRUE,A2:C2)

Google Sheets: Enter East, Widget, and 420 in A2:C2. Returns: East, Widget, 420

Preserve blank position
=TEXTJOIN(" ",FALSE,A2:C2)

Excel: Enter Maya in A2, leave B2 blank, and enter Chen in C2. Returns: Maya Chen

Common errors and fixes

IssueLikely causeFix
The result has unwanted double separatorsFALSE includes blank cells and therefore preserves their separator positions.Use TRUE when blank cells should be skipped, or clean the source range first.
The combined text contains odd spacingSource cells contain leading or trailing spaces that TEXTJOIN does not remove.Apply TRIM to source values before combining when spacing is not meaningful.
The formula returns a length errorThe combined result exceeds the spreadsheet cell character limit or the range is unnecessarily broad.Narrow the source range or split the output across cells.

When not to use this formula

  • Do not use TEXTJOIN when the combined values must remain separately sortable or independently editable in the output.

Alternatives

AlternativeWhen to use it
Remove Spaces FormulaUse when the main task is cleaning source spacing before combining values.
Split Text FormulaUse when a combined string needs to be separated into cells again.

Related formulas

Official references

FAQ

What does TRUE do in TEXTJOIN?

TRUE skips empty cells, so their separators are not added to the result.

Does TEXTJOIN clean source spacing?

No. It joins the values as supplied, so use TRIM when source cells contain unwanted spaces.