Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default pull numbers from text string

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
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



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default pull numbers from text string

Thanks for your help! The first formula worked great. Tbe second
formula is simply returning whatever was in the first cell. I think
that is because the first formula returns "Apt###" and not "Apt ###"
which is what is A2.

On Mar 17, 11:17 pm, "T. Valko" wrote:
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





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default pull numbers from text string

On 19 Mar 2007 09:16:52 -0700, "
wrote:

Thanks for your help! Works well.


You're welcome. Thanks for the feedback.
--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default pull numbers from text string

That's because the first formula got messed up due to line wrap. There is a
space after "Apt":

="Apt
"&LOOKUP(10^10.............

Should be:

="Apt "&LOOKUP(10^10............

Biff

wrote in message
ups.com...
Thanks for your help! The first formula worked great. Tbe second
formula is simply returning whatever was in the first cell. I think
that is because the first formula returns "Apt###" and not "Apt ###"
which is what is A2.

On Mar 17, 11:17 pm, "T. Valko" wrote:
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





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default pull numbers from text string

Or, if you don't want "Apt ###" and just want the number by itself:

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

Biff

"T. Valko" wrote in message
...
That's because the first formula got messed up due to line wrap. There is
a space after "Apt":

="Apt
"&LOOKUP(10^10.............

Should be:

="Apt "&LOOKUP(10^10............

Biff

wrote in message
ups.com...
Thanks for your help! The first formula worked great. Tbe second
formula is simply returning whatever was in the first cell. I think
that is because the first formula returns "Apt###" and not "Apt ###"
which is what is A2.

On Mar 17, 11:17 pm, "T. Valko" wrote:
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting a numbers from a text string IPerlovsky Excel Worksheet Functions 24 February 27th 07 04:55 PM
Extracting numbers from string of text Marie Excel Discussion (Misc queries) 2 November 21st 06 09:46 PM
Need to pull a selected segment of numbers/text from a large strin Kidsimba Excel Worksheet Functions 1 November 8th 06 12:08 AM
Pull last word from a text string in Excel nmp Excel Worksheet Functions 8 September 25th 06 10:13 PM
extracting numbers within text string! via135 Excel Worksheet Functions 6 May 5th 06 06:08 AM


All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"