Home > Formulas > Text > Split Address Split Address With FormulasHow to use Excel formulas, or quick tricks, to split a full address into columns for street, city, state and zip code. Formula examples use text functions -- LEFT, RIGHT, MID, SUBSTITUTE, FIND, SEARCH and more. If you have Excel 365, use the new text functions - TEXTBEFORE, TEXTAFTER, TEXTSPLIT -- they're simpler to set up. |
Split Address Without FormulasIn the examples below, the full address is in a worksheet cell. The goal is to split the Street Address, City, State and Zip Code into separate columns, in the same row. First, there are two quick methods shown below, to separate the data into different columns, without using formulas.
Results Do Not UpdateWith these two non-formula methods, the data is separated into columns, and is no longer connected to the original full address.
When to Use Non-Formula MethodsThese solutions are quick and easy, if you don't plan to change the "full address" cell in the future. For example,
|
Flash Fill to Split AddressIf there is a consistent pattern to the way the full address is entered in each cell, the built-in Flash Fill feature is a quick way to split the address into separate columns. In this screen shot, there is a consistent pattern to the address data in each cell:
Split Address with Flash FillFollow these steps to split the address with a Flash Fill:
The Excel Flash Fill completes the entries in all of the columns, based on the manual entries in the first row. |
Video: Flash Fill ShortcutIn this short video, Sarah shows how to separate data from one cell, into multiple columns, using the Flash Fill Shortcut - Ctrl+E |
Text to Columns for Comma SeparatedIn this example, the full address is in column A, with the Street Address, City, State and Zip Code all in one cell, separated by commas.
To split the Street Address, City, State and Zip Code into separate columns, without formulas, you can use Excel built-in Text to Columns feature. Split Address With Text to ColumnsFollow these steps to split the address with the Text to Columns feature:
|
Convert Text to Columns WizardThe Convert Text to Columns Wizard opens, showing Step 1 of 3
In Step 2 of 3, you'll set the delimiters for your data:
In Step 3 of 3, you'll set the final details for your data:
The Excel Text to Columns feature splits each address into columns, and the full address remains in column A. |
Split Address With FormulasIn this example, the full address is in column A, with the Street Address, City, State and Zip Code all in one cell, separated by commas.
To split the Street Address, City, State and Zip Code into separate columns, you can use Excel formulas - see the details below. Results Do UpdateWith these formulas, the data is separated into columns, and the parts of the address, created from formulas, are still connected to the original full address.
When to Use Formula MethodIt takes a bit longer to set up formulas, instead of using Flash Fill or Text to Columns. However, it's worth the effort, if you plan to change the "full address" cells in the future. For example,
|
Formulas to Find the CommasIn each full address, there are 3 comma separators:
To find the position of each comma, 3 new columns will be added to the table. Named Cell for SeparatorFirst, a named range is created on the worksheet in cell F1.
This named cell makes it easy to do a couple of things:
|
Comma FormulasThree new columns were added to the address table, with these headings: Cm1, Cm2, Cm3 Here are the formulas in those columns, to find the positions of the 1st, 2nd, and 3rd commas in the full address.
All 3 formulas use the FIND function, with these 2 arguments:
The FIND function has an optional 3rd argument -- start_num
Street Address FormulaTo return the street address from the full address, the formula uses the LEFT functions: =LEFT(A4,F4-1) The number of characters in the street address is calculated from the position of the first comma (in cell F4), minus 1. City FormulaTo return the city name from the full address, the formula uses the MID function =MID(A4,F4+1,G4-F4-1) The MID function has 3 arguments:
|
State FormulaTo return the state code from the full address, the formula uses the MID function. It's similar to the City formula, but uses the positions of the 2nd and 3rd commas =MID(A4,G4+1,H4-G4-1) The MID function has 3 arguments:
Zip Code FormulaFinally, to return the zip code, the formula uses the RIGHT and LEN functions: =RIGHT(A4,LEN(A4)-H4) The number of characters in the street address is calculated from:
|
Split Address with New FunctionsIf you're using Excel 365, there are new text functions that make it easier to separate a full address into columns, using formulas :
Advantages of New FunctionsThese new functions are like fancier versions of the old Excel LEFT and RIGHT functions, or the Text to Columns feature. The new functions are much simpler and cleaner to use than the function combinations available in older versions of Excel. Functions OverviewFirst, I'll show you a quick overview of the new text functions -- 1) TEXTBEFORE and TEXTAFTER -- 2) TEXTSPLIT (and CHOOSECOLS) After that, I'll show how to split a full address into separate columns, for street, city, state and zip code, with formulas using these new functions. 1) TEXTBEFORE and TEXTAFTERThe TEXTBEFORE and TEXTAFTER functions are almost identical, except that they get text that's before a specific delimiter character or after the delimiter. Here are the function syntax arguments for both functions, and they are exactly the same. Each function has 2 required arguments, and 4 optional arguments
2) TEXTSPLIT and CHOOSECOLSThe TEXTSPLIT function separates a text string into an array of separate columns, based on one or more delimiters. To get specific parts of the split address, the examples below also use the new CHOOSECOLS function. Here are the function syntax arguments for the TEXTSPLIT function, with 2 required arguments, and 4 optional arguments.
Here are the function syntax arguments for the CHOOSECOLS function, with 2 required arguments, and optional arguments for additional column numbers.
|
Split Address with TEXTBEFORE and TEXTAFTERHere are the formulas to extract each part of the full address, using TEXTBEFORE and TEXTAFTER formulas. Street AddressThe street address is in the first part of the full address, and is followed by a hyphen
The following formula is entered in cell C5, and copied down, to get the street address in each row:
Here's what that formula does:
ZipCodeThe street address is in the last part of the full address, with a space character before it
The following formula is entered in cell F5, and copied down, to get the zip code in each row:
Here's what that formula does:
|
City and StateThe city and stare are in the middle part of the full address, so a combination of TEXTBEFORE and TEXTAFTER is used to extract those two parts of the address.
Here is the City formula, in cell D5, and copied down:
Here is the State formula, in cell E5, and copied down:
|
Split Address with TEXTSPLITHere are the formulas to extract each part of the full address, using TEXTSPLIT Function formulas. The CHOOSECOLS function returns a specific column from the column array that TEXTSPLIT creates. NOTE: On its own, TEXTSPLIT cannot be used in a formatted Excel table, because the results will not spill into adjacent columns - the result will be a #SPILL# error. Street AddressThe following formula is in cell C5, and copied down, to get the street address in each row:
Here's what that formula does:
City, State, and Zip CodeHere are the remaining TEXTSPLIT and CHOOSECOLS formulas. They work like the Street Address formula, but with different delimiters and column numbers.
|
Flash Fill or FormulasIn this challenge, a few people said that they would use Flash Fill, instead of formulas, to split the addresses. Flash Fill was introduced in Excel 2013, and it helps you extract information, based on patterns in your data. You can use it to put names in reverse order, split dates and times, and many other data tasks. Flash Fill isn't right for every job, but is helpful in some cases:
Here's how to use Flash Fill in the Split Address challenge:
Note: The screen shot is an animated gif, so it might not work in all browsers. |
Download Sample FilesSplit Address Examples: To see the split address examples for Flash Fill, Text to Columns, and formulas based on comma positions, download the Split Address Examples workbook. The zipped file is in xlsx format, and does not contain any macros. Split Address Excel 365: In Excel 365, use the new text functions for an easier way to separate a full address into columns. Download this file to see formulas with TEXTBEFORE, TEXTAFTER, TEXTSPLIT and CHOOSECOLS functions. The zipped file is in xlsx format, and does not contain any macros Split Address Challenge: To see the Split Address challenge, and suggested solutions, download the Split Address Challenge workbook. The zipped file is in xlsx format, and does not contain any macros. More Tutorials |
Last updated: January 2, 2023 6:58 PM