How do I extract a zip code from a column that may have a random amount of text (body of text) in a spreadsheet?

cmanlongat

New Member
Joined
May 10, 2016
Messages
21
Hi all,

I have a spread sheet with a column that includes a random amount of text like so:

-----------------------


Contact Name:


Contact Email:


Contact Phone:

I am interested in 1234NE 12Tth, Williston, FL 32696.


Search CriteriaCity :
State :
ZIP : 0
MinLotSize : 0
MaxLotSize : 0
MinYearBuilt : 0
MaxYearBuilt : 0
PropertyTypes : CondoApartment, LotsLand, Manufactured, MultiFamily, SingleFamily

-------------------

What I want to do: Extract only the zip code from this column.
My problem: I cannot find a formula to complete this task because every cell is different. Some may display the above posted or some may have double the text, so I am not sure how to pinpoint the formula to do what I want it to do.

Any help would be very much appreciated.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Will the line of text with the zip code always start with the words "I am interested in"?

Will there always be a period after the zip code?
 
Upvote 0
Hi Rick,

Neither, "I am interested in" or a period after the zip code are included in the column. Can this even be done? Thanks.
 
Upvote 0
As a matter of fact, yes, a MAJORITY of the text include "I am interested in" following a zip code with the respective state. Hope this helps.
 
Upvote 0
Here's one way:

AB
1I am interested in 1234NE 12Tth, Williston, FL 32696.32696

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet25

Array Formulas
CellFormula
B1{=MAX(IFERROR(MID(A1,ROW(INDIRECT("1:"&LEN(A1)-4)),5)+0,0))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



This is an array formula, confirm it with Control+Shift+Enter when you put it in the formula bar.

This formula will find the largest 5-digit number in the cell. And as such, it has some limitations. If there are other 5-digit numbers, or longer numbers, it might not grab the right one. If you have some odd text, such as 11e11, then it could grab that. But depending on your data, it might work for you. Let me know if it works, or if you think it might need some tweaking.
 
Upvote 0
As a matter of fact, yes, a MAJORITY of the text include "I am interested in" following a zip code with the respective state. Hope this helps.
Unfortunately, a "majority" is not enough to lock onto... I would need "always" in order to do it. In looking at your data again, would it be correct to say that, excluding blank cells, that every value has a colon in it except for the address value that you want to parse?
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,698
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top