View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default pull numbers from text string

Try this using the built-in functions:

For the apt number:

A2 = Northgate I Apt 342

Formula entered in B2:

="Apt
"&LOOKUP(10^10,--MID(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"01234567 89")),ROW(INDIRECT("1:255"))))

For the name:

Formula entered in C2:

=TRIM(SUBSTITUTE(A2,B2,""))

Book list:

http://contextures.com/xlbooks.html

Biff

wrote in message
ps.com...
I am trying to clean up an address table in excel. Here is example of
the row I am working with:

Northgate I Apt 342
Northgate I Apt 242
Apt 242 Northgate I
Apt 43 Northgate I

I want to take each address and create two new columns, one for
"Northgate I" and one for Apt###, with whatever apartment # is in the
cell. One of the problems is that the cells are not uniformly name/
apart#, but rather, in all sorts of combinations. There are never more
than 3 numbers after "Apt", and the numbers always come after "Apt"

Any help or advice would be great. I am also looking to learn some
VBA. Any websites or books you recommend for learning VBA for Excel?

Thanks,
Michael