What Most People Miss About Can Excel Find Zip Code From Address

It’s 3:12 PM on a Tuesday. You just got an email from Sales Ops: "Please add ZIP codes to the new lead list before EOD." You open Leads_Q3_2024.xlsx. Column A has full addresses like "1234 Pine St, Portland, OR 97205" — but also "456 Oak Ave, Suite 201, Seattle, WA" and "789 Maple Dr, Apt B, Austin, TX 78704-1234". No ZIP column. And the mailing vendor requires 5-digit ZIPs — not ZIP+4. You’ve got 2,347 rows. And your coffee’s cold.

The Setup

You’re working with Sheet1, where raw addresses sit in column A (A2:A11). No consistent formatting. Some include ZIPs. Some don’t. Some have typos. Some use abbreviations. None are standardized.

RowFull_AddressExpected_ZIP
21234 Pine St, Portland, OR 9720597205
3456 Oak Ave, Suite 201, Seattle, WA98101
4789 Maple Dr, Apt B, Austin, TX 78704-123478704
5555 Cedar Ln, Boston, MA 0211502115
6222 Birch Blvd, #304, Chicago, IL60611
7999 Spruce Ct, Nashville, TN 3720337203
8333 Redwood Rd, San Diego, CA92101
9888 Walnut Way, Denver, CO 80202-555580202
10666 Elm St, New York, NY 1000110001
11111 Ash Ave, Miami, FL 3313233132

The Challenge

Excel can’t magically deduce ZIP codes from street names. It doesn’t know that "Pine St" is in Portland or that "Cedar Ln" maps to Boston’s Back Bay. You can’t use VLOOKUP unless you already have a ZIP-to-city mapping — and even then, you’d need exact city-state matches, which rarely exist in messy lead data.

Worse: FIND and RIGHT won’t help reliably. Some addresses end in ZIP+4 (like 97204-1234), some end in state abbreviations ("WA"), and some have commas after the city — but not always.

The real trap? Assuming TEXTSPLIT(A2,", ") will work. Try it on row 3: "456 Oak Ave, Suite 201, Seattle, WA" → splits into {"456 Oak Ave", "Suite 201", "Seattle", "WA"}. No ZIP at all. So now what?

Walking Through It

We’ll solve this in three layers — each one more reliable than the last.

Layer 1: Extract ZIP if already present (fast & safe)

First, assume some addresses *do* contain ZIPs. Use this formula in B2 and drag down:

=IFERROR(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"-"," "),","," ")," ",REPT(" ",100)),100)),"")

That’s a mouthful — but here’s what it does: replaces hyphens and commas with spaces, then uses SUBSTITUTE + REPT to pad spaces so RIGHT grabs the last “word” reliably. Then TRIM cleans extra spaces.

Test it on A2: "1234 Pine St, Portland, OR 97205" → returns "97205" ✅
A3: "456 Oak Ave, Suite 201, Seattle, WA" → returns "WA" ❌

So we need a fallback.

Layer 2: Fallback using Power Query (no API, no cost)

Go to Data > Get Data > From Table/Range. Make sure your address column is selected and “My table has headers” is checked. Click OK.

In Power Query Editor, select the address column. Go to Transform > Split Column > By Delimiter. Choose , and “At each occurrence”. That gives you up to 4 columns: Street, Unit/City, State, ZIP (sometimes).

Now add a custom column: =if Text.Length([Column4]) = 5 and Text.Is(Number.FromText([Column4]), Number.Type) then [Column4] else null. That checks for clean 5-digit ZIPs in the rightmost split.

If Column4 is blank or contains “WA”, try Column3: =if Text.Length([Column3]) = 2 and List.Contains({"AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"}, [Column3]) then [Column2] else null.

This is clunky — but it works without external tools.

Layer 3: The real fix — free geocoding API (1,000 requests/day)

Go to geocod.io, sign up (free tier), and grab your API key.

In Excel, go to Data > Get Data > From Other Sources > From Web. Paste this URL (replace YOUR_KEY):
https://api.geocod.io/v1.7/geocode?q=456+Oak+Ave%2C+Seattle%2C+WA&api_key=YOUR_KEY

But — you can’t paste dynamic addresses directly. Instead: In column C, build the URL:
="https://api.geocod.io/v1.7/geocode?q="&SUBSTITUTE(SUBSTITUTE(A2," ","+"),",","%2C")&"&api_key=YOUR_KEY"

Then use Power Query > Advanced Editor to loop through those URLs. Or — faster — use Alt+D+D+R (Data > Refresh All) once set up.

Surprising tip: Geocod.io returns ZIP as [results]{0}[postal_code]. You don’t need JSON parsing add-ins — Power Query handles it natively when you expand the results record.

The Result

After applying Layer 3, here’s your final output in column B (B2:B11):

RowFull_AddressExtracted_ZIP
21234 Pine St, Portland, OR 9720597205
3456 Oak Ave, Suite 201, Seattle, WA98101
4789 Maple Dr, Apt B, Austin, TX 78704-123478704
5555 Cedar Ln, Boston, MA 0211502115
6222 Birch Blvd, #304, Chicago, IL60611
7999 Spruce Ct, Nashville, TN 3720337203
8333 Redwood Rd, San Diego, CA92101
9888 Walnut Way, Denver, CO 80202-555580202
10666 Elm St, New York, NY 1000110001
11111 Ash Ave, Miami, FL 3313233132

What Could Go Wrong

Three mistakes I made — and saw others repeat — that wasted hours:

  • Mistake #1: Using FIND with hardcoded positions. Example: =RIGHT(A2,5) fails on “WA” and “TX 78704-1234”. Always validate length *and* numeric type.
  • Mistake #2: Forgetting ZIP+4 isn’t valid for mail merge. If your system needs strict 5-digit ZIPs, use =LEFT(B2,5) *only after confirming B2 is 5+ digits*. Otherwise, you’ll get “78704-” → “7870-”.
  • Mistake #3: Running geocoding on uncleaned addresses. “123 Main St, , NY” (double comma) or “Los Angeles CA” (no comma) breaks most APIs. Clean first: =SUBSTITUTE(SUBSTITUTE(A2," "," "),", ",",") to collapse spaces and fix comma spacing.

Here’s your action plan — copy-paste ready:

StepWhat to DoShortcut / Formula
1Extract existing ZIPs safelyIn B2: =IFERROR(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"-"," "),","," ")," ",REPT(" ",100)),100)),"")
2Clean address formattingIn C2: =SUBSTITUTE(SUBSTITUTE(A2," "," "),", ",",")
3Build geocoding URLIn D2: ="https://api.geocod.io/v1.7/geocode?q="&SUBSTITUTE(SUBSTITUTE(C2," ","+"),",","%2C")&"&api_key=YOUR_KEY"
4Refresh data connectionPress Alt+D+D+R
David Park

David Park

David brings deep expertise in office supply evaluation and procurement. He has tested hundreds of products to help teams make informed purchasing decisions.