EZRoutePlanner

Spreadsheets & addresses

How to combine address columns in Excel (street, city, state, ZIP)

Copy-ready formulas for Excel and Google Sheets, the ZIP code trap that breaks New England addresses, and how to go the other way when one cell holds the whole address.

EZRoutePlanner teamUpdated 6 min read

The short answer

To combine address columns in Excel, add a column with a formula that joins the parts with commas: =TEXTJOIN(", ", TRUE, B2, C2, D2&" "&E2) when Street is in B, City in C, State in D and ZIP in E. In older versions of Excel use =B2&", "&C2&", "&D2&" "&E2. Fill the formula down, then paste the column back as values.

Excel 2019 and later
TEXTJOIN adds separators and skips empty cells
Any version of Excel
Join with & and type each separator
ZIPs that lost a zero
Wrap them in TEXT(E2,"00000")
No formula at all
Flash Fill: type one example, press Ctrl+E
On this page

01

What's the best formula to combine address columns in Excel?

TEXTJOIN is the best formula for combining address columns in Excel 2019, Excel 2021 and Microsoft 365. It puts a separator between each part and skips empty cells, so a row with a missing piece doesn't end up with a stray comma. Every example on this page uses this layout:

The example sheet
ABCDE
Row 1NameStreetCityStateZIP
Row 2Brightwater Bakery88 Pleasant StBrooklineMA02446
The example sheet
Excel 2019, 2021, Microsoft 365 and Google Sheets
=TEXTJOIN(", ", TRUE, B2, C2, D2 & " " & E2)

That returns 88 Pleasant St, Brookline, MA 02446. The state and ZIP are joined with a plain space first, because addresses are written MA 02446, not MA, 02446. The TRUE tells TEXTJOIN to ignore empty cells.

To copy the formula down, double-click the fill handle, the small square at the cell's bottom-right corner. Excel fills as far down as the column next to it has data.

02

How do you combine cells in older versions of Excel?

Use the ampersand (&), which joins text in every version of Excel and in every other spreadsheet app. Type each separator in quotes between the cells.

Any version of Excel, Google Sheets, LibreOffice
=B2 & ", " & C2 & ", " & D2 & " " & E2

CONCATENATE does the same job with commas between the pieces, and still works everywhere. CONCAT, its newer replacement in Excel, also accepts ranges, but unlike TEXTJOIN it adds no separators, so you still type each one.

CONCATENATE (any version) and CONCAT (Excel 2019 and later)
=CONCATENATE(B2, ", ", C2, ", ", D2, " ", E2)
=CONCAT(B2, ", ", C2, ", ", D2, " ", E2)

Adding a unit only when there is one

Ampersand formulas don't skip blanks. If some rows have an apartment or suite in column F, wrap it in IF so an empty unit adds nothing. Rows with a unit become 88 Pleasant St Unit 3, Brookline, MA 02446; the rest are unchanged.

Street plus an optional unit
=B2 & IF(F2 = "", "", " " & F2) & ", " & C2 & ", " & D2 & " " & E2

03

Why did my ZIP codes lose their leading zero?

Excel treats a ZIP code like 02446 as the number 2446 and drops the zero. It happens to every ZIP that starts with 0, which covers New England, New Jersey and Puerto Rico. A map may still find Brookline, MA 2446 from the town name, but a four-digit ZIP doesn't help it, and on a row with no city it can fail outright. Other causes of misplaced pins are in why addresses land in the wrong place.

Put the zero back inside the formula
=TEXTJOIN(", ", TRUE, B2, C2, D2 & " " & TEXT(E2, "00000"))
Excel: a mix of 5-digit and ZIP+4 codes
=IF(LEN(E2) > 5, TEXT(E2, "00000-0000"), TEXT(E2, "00000"))

04

How do you clean up spaces and capitals before combining?

Run each part through TRIM. TRIM removes spaces at the start and end of a cell and squeezes double spaces down to one. They matter more than they look: 88 Pleasant St and 88 Pleasant St can make two copies of one address look different to a duplicate check.

Trim every part, and fix the ZIP
=TEXTJOIN(", ", TRUE, TRIM(B2), TRIM(C2), TRIM(D2) & " " & TEXT(E2, "00000"))

Text copied from a website or a PDF sometimes carries non-breaking spaces, which look like spaces but which TRIM leaves alone. Swap them for ordinary spaces first:

Remove non-breaking spaces
=TRIM(SUBSTITUTE(B2, CHAR(160), " "))

PROPER turns 88 PLEASANT ST into 88 Pleasant St. It's cosmetic, since maps ignore capitals, and it has quirks: NW becomes Nw, MCALLISTER becomes Mcallister and 5TH AVE becomes 5Th Ave. Use it for printed lists and mail merges, not because a map needs it.

Before you combine

  • ZIP column formatted as Text, or wrapped in TEXT(E2,"00000").
  • Every part trimmed of stray spaces.
  • One style in the State column: MA or Massachusetts, not both.
  • Subtotal rows, blank rows and repeated header rows deleted.
  • Phone numbers and notes kept out of the address columns.

05

Can Excel combine addresses without a formula?

Yes, with Flash Fill. Type the first combined address by hand in the column next to your data, exactly as you want it, then press Ctrl+E or choose Data → Flash Fill. Excel spots the pattern and fills the rest of the column with plain text, not formulas.

  • Check the odd rows. Flash Fill copies your example, so a row with no ZIP or an extra unit can come out wrong. Type a second example on a row that's different and run it again.
  • It doesn't update. Change a street later and the combined column stays as it was. Formulas keep up; Flash Fill doesn't.
  • Google Sheets has a cousin. Smart Fill offers to fill the column when it sees a pattern as you type.

06

How do you combine address columns in Google Sheets?

The same TEXTJOIN and ampersand formulas work in Google Sheets. Two differences matter: CONCAT in Sheets joins only two values, so use CONCATENATE or & instead, and ARRAYFORMULA can fill the whole column from a single cell.

Google Sheets: one formula for the whole column
=ARRAYFORMULA(IF(B2:B = "", "", B2:B & ", " & C2:C & ", " & D2:D & " " & E2:E))

The array version uses ampersands on purpose: TEXTJOIN inside ARRAYFORMULA joins the entire column into one cell instead of working row by row. Sheets also has JOIN, which works like TEXTJOIN but doesn't skip empty cells.

07

How do you split a full address into separate columns?

To go the other way, from one Address column to Street, City, State and ZIP, use Data → Text to Columns in Excel: choose Delimited, tick Comma, and finish. Each comma-separated part lands in its own column.

  • Insert empty columns to the right first. Text to Columns writes over whatever is next door.
  • State and ZIP stay together (MA 02446) because there's no comma between them. Run Text to Columns on that column again with Space as the delimiter, and in the last step set the ZIP column's format to Text so the zeros survive.
  • Rows with a unit after a comma (88 Pleasant St, Unit 3, Brookline) come out one column longer than the rest. Filter for a filled-in extra column to find them.
Microsoft 365: split with a formula
=TEXTSPLIT(A2, ", ")
Google Sheets
=SPLIT(A2, ", ", FALSE)

The FALSE matters in Sheets: without it, SPLIT breaks at every comma and every space, chopping the street into separate words. If the list is headed for the EZRoutePlanner Excel route planner you can skip both directions, because its import reads the address whether it's in one column or several. The full walk-through is in how to map addresses from Excel.

Free toolAddress list cleanerPaste rows straight from your sheet and get one clean, de-duplicated address per line, with no formula to write.

Questions people ask

What's the formula to combine city, state and ZIP in Excel?

Use =C2 & ", " & D2 & " " & E2, which gives Brookline, MA 02446. Add B2 & ", " & at the front to include the street.

How do I put the street and the city on separate lines in one cell?

Join them with CHAR(10), the line-break character: =B2 & CHAR(10) & C2 & ", " & D2 & " " & E2, then turn on Wrap Text for the column. Use this for mailing labels only; maps and route planners expect the address on one line.

Why does my formula show as text instead of the address?

The cell was formatted as Text before you typed the formula, so Excel stored the formula as words. Change the cell's format to General, click into the cell, and press Enter.

How do I turn the formula results into plain text?

Copy the column, then use Paste Special → Values on the same spot. In Google Sheets, Ctrl+Shift+V (Cmd+Shift+V on a Mac) pastes values only.

Should I add the country to each address?

Not for a list that's all in one country. For a mixed list, add the country at the end of every row, such as USA or Canada, so a street name shared across borders can't match the wrong one.

What order should the address parts go in?

Street, then unit, then city, then state and ZIP, then country: 88 Pleasant St Unit 3, Brookline, MA 02446. Maps are fairly forgiving, but that order is the one they match most reliably.

Plan your next route in minutes.

Paste your addresses or drop in a spreadsheet, optimize the order with one click, and send it to your phone. Free to start, no credit card.

Free plan. No credit card. Works in any browser.