Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Night Owl
 
Posts: n/a
Default Removing numbers from the beginning of a text string

I have a long list of addresses, some of which start with a house number
then a comma. Is there a (simple) way of finding the position of the comma
within the first (say) 5 characters of the string, and, if it exists, remove
everything to the left of and including the comma, leaving the rest of the
text string?

Thanks in advance,

Pete


  #2   Report Post  
William
 
Posts: n/a
Default

Hi Night Owl

Doubtless there are better ways, but if the address is in A2, enter the
following in B2 and copy down.

=IF(ISERROR(FIND(",",LEFT(A2,5),1)),A2,TRIM(RIGHT( A2,LEN(A2)-FIND(",",LEFT(A2,5),1))))

--


XL2003
Regards

William



"Night Owl" wrote in message
...
I have a long list of addresses, some of which start with a house number
then a comma. Is there a (simple) way of finding the position of the comma
within the first (say) 5 characters of the string, and, if it exists,
remove everything to the left of and including the comma, leaving the rest
of the text string?

Thanks in advance,

Pete




  #3   Report Post  
Max
 
Posts: n/a
Default

Assuming data is in col A, A1 down

Try in B1:
=IF(ISNUMBER(SEARCH(",",TRIM(A1))),TRIM(MID((TRIM( A1)),SEARCH(",",TRIM(A1))+
1,99)),TRIM(A1))
Copy down

The "99" within MID is arbitrary.
Adjust to a higher number if necessary
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Night Owl" wrote in message
...
I have a long list of addresses, some of which start with a house number
then a comma. Is there a (simple) way of finding the position of the

comma
within the first (say) 5 characters of the string, and, if it exists,

remove
everything to the left of and including the comma, leaving the rest of the
text string?

Thanks in advance,

Pete




  #4   Report Post  
Night Owl
 
Posts: n/a
Default

Thanks for your replies, guys. I've managed to sort this, now. Thank you.

You wouldn't mind having a look at my next post, would you :-)

Peter

"Night Owl" wrote in message
...
I have a long list of addresses, some of which start with a house number
then a comma. Is there a (simple) way of finding the position of the comma
within the first (say) 5 characters of the string, and, if it exists,
remove everything to the left of and including the comma, leaving the rest
of the text string?

Thanks in advance,

Pete



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
How to reformat numbers stored as text (apostrophe at beginning) Dave Excel Discussion (Misc queries) 1 May 11th 05 02:34 AM
Concantenate Text with numbers with fixed form sunslight Excel Worksheet Functions 2 April 24th 05 01:39 AM
How to convert Excel imported numbers from text to numbers? Alden Excel Discussion (Misc queries) 9 April 1st 05 09:51 PM
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 10:19 PM


All times are GMT +1. The time now is 01:17 PM.

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

About Us

"It's about Microsoft Excel"