Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Extracting Street Numbers from an Address.

# Extracting Street Numbers from an Address

by Allen Wyatt
(last updated November 8, 2018)

Allan has a list of several hundred names and addresses. The street addresses range from Main Street, 123 Main Street, US RT 2, or 187 South Elm St. He would like to break out the street number from the addresses. So the address 123 Main Street would end up with "123" in one cell and "Main Street" in another. If there is no street number, then nothing ends up in the street number column. The Text to Columns tool will not work and he wonders how he can do this.

In a perfect world, Excel would allow you to easily split the numbers from the street names. Since this option doesn't exist, you have a couple of choices. The most time-consuming option involves adding an additional column and retyping the data. If, however, you would like to save some time, you can use a variety of formulas to accomplish the task.

Assuming the list of addresses is in column A (beginning in cell A1), you could use a formula similar to the following to pull out the numeric portion of the address:

```=IF(ISERROR(VALUE(LEFT(A1,1))),"",LEFT(A1,FIND(" ",A1)-1))
```

Assuming you put the formula in cell B1, you could then use a different formula to derive the non-numeric portion of the address:

```=TRIM(RIGHT(A1,LEN(A1)-LEN(B1)))
```

Note that this approach does have a limitation. Some addresses, especially in major metropolitan areas, use a format such as 152-33 Bell Blvd. The formulas above will work for these addresses, but if the alternative, 152 33 Bell Blvd., is used, the formula will parse incorrectly. Unless you want to buy a professionally developed address-parsing program, the formulas above and a quick eyeball scan of the results should be adequate.

Another formula works in this case. Assuming your address is in cell A2, enter the following formula into cell B2:

```=IF(ISNUMBER(VALUE(LEFT(A2,1))),VALUE(LEFT(A2,FIND(" ",A2)-1)),"")
```

This formula is saying, "If the first character is not a number, leave the cell blank. Otherwise, give me all of the characters on the left out to, but not including, the first space." You can then use the result of this formula to pull out the non-numeric portion of the address:

```=IF(B2="",A2,MID(A2,FIND(" ",A2)+1,99))
```

Another approach is to use an array formula. Here again, assuming your address is in cell A2, you can use the following:

```=IF(ISNUMBER(1*MID(A2,ROW(\$1:\$1),1)) = TRUE,
LEFT(A2,FIND(" ",A2,1)),"")
```

Since this is an array formula you need to enter it by using Ctrl+Shift+Enter. The result is that the formula returns the leading numeric portion of the address. You can then determine the non-numeric portion by using the following array formula:

```=IF(ISNUMBER(1*MID(A2,ROW(\$1:\$1),1)) = TRUE,
RIGHT(A2,LEN(A2)-FIND(" ",A2,1)),A2)
```

Finally, the following macro can be used to breakout the street address from the street name.

```Sub GetStreetNum()
Dim sStreet As String
Dim J As Integer
Dim iNum As Integer

For Each cell In Selection
sStreet = cell.Value
J = InStr(sStreet, " ")
If J > 0 Then
iNum = Val(Left(sStreet, J))
If iNum > 0 Then
cell.Offset(0, 1).Value = iNum
sStreet = Trim(Mid(sStreet, J, Len(sStreet)))
End If
End If
cell.Offset(0, 2).Value = sStreet
Next
End Sub
```

To use this macro, simply select the range of cells that contain your addresses and then run it. The leading numeric portion of the address will appear in the cell to the right of each address and the balance of the address will be placed in the cell to the right of that. (So you should make sure that there are two blank columns to the right of the addresses you select.)

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8029) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Extracting Street Numbers from an Address.

##### Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

##### MORE FROM ALLEN

Converting Time Notation to Decimal Notation

Want to convert an elapsed time, such as 8:37, to a decimal time, such as 8.62? If you know how Excel stores times ...

Discover More

Multiple Print Areas on a Single Printed Page

Want to print small, non-contiguous areas of your worksheet all on a single page? You might think that defining a ...

Discover More

AutoFill with Random Numbers

When entering data into a worksheet, you may have a need to fill a range of cells with a group of random numbers. This ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

Incrementing Numeric Portions of Serial Numbers

If you use serial numbers that include both letters and numbers, you might wonder how you can increment the numeric ...

Discover More

Solving Simultaneous Equations

One branch of mathematics allows you to work with what are called "simultaneous equations." Working with this type of ...

Discover More

Condensing Sequential Values to a Single Row

If you have a bunch of ZIP Codes or part numbers in a list, you may want to "condense" the list so that sequential series ...

Discover More
##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. Youâ€™ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three minus 0?

2018-11-06 17:36:21

Sam

I tried the macro but it does not work the macro for the whole column it stops at a certain row and does not go until the end of the column. Why not?

2015-03-23 12:43:55

Matt Foster

Nice post. As an alternative, we have created a desktop application which splits addresses exactly like the ones you have specified from one cell into street, city, state, and zip/postal code columns. You just select the file that you want to split.This program doesn't split on any delimiter, but rather looks at the data itself to make its determinations. Here's a link for more information: http://fosteringllc.com/product/address-deconstructor/ and a video explaining how the program works can be found here http://youtu.be/Fw4RM7GR3Js
Hope this helps,
Matt

2015-01-22 09:37:56

Philipp

A more elegant way to do this is with this Excel Add-In. It seperates address data in seperate columns AND corrects (!!!) the data. Look at the video here: https://www.youtube.com/watch?v=6RYD_I9PwX8

Greets!

Philipp

2014-10-09 23:39:38

Rose Graham

The macro worked great for a data file I had downloaded form a City Crime website with its address field coded as text. The function formulas did not work,possibly because the street number was coded as text and not a number?

##### This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."