# How to combine cells with a comma and skip blanks in Excel

Use TEXTJOIN with TRUE as the second argument: =TEXTJOIN(", ",TRUE,A2:E2) puts ", " between the values and skips empty cells.

**Excel:** `=TEXTJOIN(", ",TRUE,A2:E2)` (Excel 2019 and later, including Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F |
| --- | --- | --- | --- | --- | --- |
| Street | Unit | City | State | ZIP | Full address |
| 1420 Lake St | Apt 3 | Minneapolis | MN | 55401 |  |
| 88 Oak Ave |  | Saint Paul | MN | 55102 |  |
| 7 Elm Ct | Suite 200 | Madison | WI | 53703 |  |
| 305 River Rd |  | Fargo | ND | 58102 |  |
| 12 Pine Ln | Unit B | Duluth | MN | 55802 |  |

Formula in F2, filled to F6: `=TEXTJOIN(", ",TRUE,A2:E2)`

Result: 1420 Lake St, Apt 3, Minneapolis, MN, 55401; 88 Oak Ave, Saint Paul, MN, 55102; 7 Elm Ct, Suite 200, Madison, WI, 53703; 305 River Rd, Fargo, ND, 58102; 12 Pine Ln, Unit B, Duluth, MN, 55802

## How it works

TEXTJOIN takes the separator first, then whether to ignore empty cells, then the cells. With TRUE, a blank unit is left out entirely, so you never get ", ," in the middle of an address.

## Other ways

- `=A2&IF(B2="","",", "&B2)&", "&C2&", "&D2&", "&E2`: Works in Excel 2016 and earlier: add the optional part, with its comma, only when it isn't blank.
- `=A2&", "&B2&", "&C2&", "&D2&", "&E2`: Plain joining with &. (Blank units leave a double comma: "88 Oak Ave, , Saint Paul…".)

## Common mistakes

- A cell with only a space isn't empty, so TEXTJOIN keeps it and you get ",  ,". TRIM the source data.
- TEXTJOIN needs Excel 2019 or later. In older versions use the IF version.

## Questions

**How do I use different separators, like "City, ST 55401"?**

Join the parts yourself: `=TEXTJOIN(", ",TRUE,A2:C2)&", "&D2&" "&E2`.

**Does TEXTJOIN work in Google Sheets?**

Yes, with the same arguments.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/combine-cells-with-comma-skip-blanks
