Combine text from several cells
Join first and last names, or any columns, with a separator and no stray spaces.
The formula
Excel and Google Sheets · Excel 2019 and newer
=TEXTJOIN(" ", TRUE, A2, B2, C2)Works in every version
=TRIM(A2&" "&B2&" "&C2)How it works
" "The separator placed between the values. Use ", " for a comma list.
TRUESkip empty cells, so you never get double spaces.
A2, B2, C2The cells or ranges to join.
Example
| A: First | B: Middle | C: Last | D: Result |
|---|---|---|---|
| Ana | María | Ruiz | Ana María Ruiz |
| Tom | Lee | Tom Lee |
Tips
- TEXTJOIN also accepts whole ranges: =TEXTJOIN(", ", TRUE, A2:A20).