+ Reply to Thread
Results 1 to 6 of 6

Adding in Front and Bring Together

  1. #1
    Registered User
    Join Date
    04-21-2008
    Posts
    6

    Adding in Front and Bring Together

    I had a customer send me a bunch of phone numbers in word, I copied and pasted them one per line in excel.

    Here is the problem (2 parts)

    They were sent in the following format

    215 555 1212
    215 555-1213
    Etc..

    I need to:
    1. Eliminate all the spaces and just have it be one long number
    2. I need to add a 1 before the number

    The list is about 500 long so doing this manually would take forever... Can someone please help..

    TY

  2. #2
    Forum Contributor
    Join Date
    02-25-2008
    Posts
    101
    Hiya,

    Assuming that the numbers are from A1 downwards, in cell B1 type:
    =1&substitute(A1," ","")

    This will put the 1 in front and then the substitute function changes all spaces to nothing.

    Hope that helps

    edit: oh, and then autofill down column B

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try in an adjacent column:

    =1&REPLACE(REPLACE(A1,4,1,""),7,1,"")

    where A1 houses first phone number to convert.

    Then to replace original copy the entire new column go to the first cell in the original column. Go to Edit|Paste Special and select Values.

    Click Ok.

    Now you can delete the added column

    My formula assumes you can have spaces and/or dashes between the digits...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    NBVC is there a cunning reason for the complexity of your formula... or is skatmandu's just better on this occassion?

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by Cheeky Charlie View Post
    NBVC is there a cunning reason for the complexity of your formula... or is skatmandu's just better on this occassion?
    My formula is meant to replace the spaces or dashes at the 4th and 7th positions as per samples given by OP.

    The other suggestion only replaces spaces...the dashes will remain.

    I could've use nested Substitute() function too
    Last edited by NBVC; 09-14-2010 at 12:08 PM.

  6. #6
    Forum Contributor
    Join Date
    02-25-2008
    Posts
    101
    Either option will do, mine can be adjusted to include dashes or other characters, but if the spaces/dashes/etc are always gonna be in the same place NVBC's option will be best

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. trying to bring an object to the front
    By minkus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2007, 06:27 PM
  2. 2 charts, bring one to front?
    By Recoil in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-20-2007, 08:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1