Tuesday, October 9, 2012

yogi_Extract 'Pick-up at' And 'Deliver to' ZipCodes From Text In Column A For Specified Conditions

Yogi Anand, D.Eng, P.E.      Google Spreadsheet   Post  #798  Oct 09, 2012    www.energyefficientbuild.com.

user Tjennings said: (http://productforums.google.com/forum/?zx=j1qokp4rhrrx#!category-topic/docs/spreadsheets/nVUXQPbWT4g)
Extract two zip codes from one cell with lots of mixed content (html, text and numbers) 

I have an RSS feed inserting html, text and numbers all into one Column M.  
I need to extract the first two zip codes from this large cell.

The best way to identify the numbers is that there is always an exact phrase before each zip "Pick-up at: random city(length varies)", "random state(always two capital letters) 5digitzipcode" 
Example as follows "Pick-up at: MILSFORD, OH 45150<BR>"
There is always one space before the zipcode and always <BR> immediately behind the number.

The second 5 digit zipcode always has the statement "Deliver to: "random city(length varies)", "random state(always two capital letters)5 digit number"
Example as follows: "Deliver to: WAUSEONENASSA, TN 43582<BR>"
There are other sets of 5 digit numbers in the same cell but none will have the exact identifiers descried above.

I am more familiar with excel and had this working there but due to other excel limitations I have started using google docs and am excited to see all the new possibilities!!! 
Your help is greatly appreciated.
following is a solution to the problem: