Solved

Pull out zip code?

Posted on 2014-10-10
5
87 Views
Last Modified: 2014-10-27
I have addresses in a cell that is the below format. How do I pull out just the zip code?

2725 Agoura Rd, Thousand Oaks, CA 91361
0
Comment
Question by:cansevin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 37

Expert Comment

by:bbao
ID: 40373568
if the addresses are for US only and the zip codes are always at the end of the addresses after their two-letter state name, you may simply extract the 5-digit zip codes by using string functions.
0
 
LVL 26

Accepted Solution

by:
ProfessorJimJam earned 500 total points
ID: 40373576
=UPPER(TRIM(RIGHT(SUBSTITUTE(TRIM(A1)," ",REPT(" ",99)),99)))
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40373600
in case if you want to pull the two digit State, let me save you time , and cover it also in this thread to pull only State CA  then here is formula   =UPPER(MID(A1,FIND(",",A1,1)+2,2))
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40373801
Cool function, ProfessorJimJam, for pulling out the zip code.    

No points, but....
The function to pull the state code doesn't work (shows first two letters of city in uppercase), but this formula will show the state code:
=RIGHT(LEFT(A1,LEN(A1)-LEN(TRIM(RIGHT(SUBSTITUTE(TRIM(A1)," ",REPT(" ",99)),99)))-1),2)

Note that it uses the LEN of the result found for the zip code as part of this.

-Glenn
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40373815
Thank you Glenn.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question