# Extracting a State and a ZIP Code in Excel

Excel is a powerful tool that can help you manage and analyze data in a variety of ways. One common task is extracting specific information from a larger data set. In this article, we will explore how to extract a state and a ZIP code from a list of addresses in Excel.

## Step 1: Separate the Address into Columns

The first step in extracting a state and a ZIP code from an address is to separate the address into columns. In most cases, an address will include the street address, city, state, and ZIP code. To separate these elements into columns, you can use the Text to Columns feature in Excel.

To use Text to Columns, follow these steps:

1. Select the column that contains the addresses you want to separate.
2. Click on the Data tab in the ribbon.
3. Click on the Text to Columns button.
4. Choose the Delimited option and click Next.
5. Select the delimiter that separates the address elements (usually a comma or a space) and click Next.
6. Choose the format for each column (General, Text, Date, etc.) and click Finish.

After you have separated the address into columns, you should have a column for the street address, a column for the city, a column for the state, and a column for the ZIP code.

## Step 2: Extract the State

Now that you have a column for the state, you can extract the state abbreviation using a formula. The state abbreviation is always two letters, so you can use the LEFT function to extract the first two letters from the state column.

To extract the state abbreviation, follow these steps:

1. Create a new column next to the state column.
2. Enter the formula =LEFT(cell,2) in the first cell of the new column, where “cell” is the cell containing the state abbreviation.
3. Copy the formula down to the rest of the cells in the column.

After you have extracted the state abbreviation, you can use Excel’s filtering or sorting features to analyze the data by state.

## Step 3: Extract the ZIP Code

Extracting the ZIP code is a bit more complicated than extracting the state abbreviation, but it can still be done using a formula. The ZIP code is always five digits, but it may be preceded by a hyphen and four additional digits. To extract the ZIP code, you will need to use a combination of the LEFT and RIGHT functions.

To extract the ZIP code, follow these steps:

1. Create a new column next to the address column.
2. Enter the formula =RIGHT(cell,5) in the first cell of the new column, where “cell” is the cell containing the address.
3. If the ZIP code is preceded by a hyphen and four additional digits, enter the formula =LEFT(cell,5) in the first cell of another new column.
4. Use the IF function to combine the two formulas into one. The formula should look like this: =IF(RIGHT(cell,5)=”XXXXX”,RIGHT(cell,5),LEFT(cell,5)), where “XXXXX” is the hyphen and four additional digits.
5. Copy the formula down to the rest of the cells in the column.

After you have extracted the ZIP code, you can use Excel’s filtering or sorting features to analyze the data by ZIP code.

## Conclusion

Extracting a state and a ZIP code from a list of addresses in Excel can be a bit tricky, but it is definitely doable. By separating the address into columns and using formulas to extract the state abbreviation and the ZIP code, you can quickly and easily analyze your data by state or ZIP code.

## Related

### Hard to find or retain a good accountant? Try cloud accounting solution

Foreign business owners or management team always take financial transparency as a pre-condition for good decision making and sustainable profitability. However, achieving the visualization of

### Cloud Accounting Software Automates Compliance Service in China

Managing accounting compliance in China can be a challenging task for businesses, as it involves dealing with complex regulations and paperwork. However, the advent of