+ Reply to Thread
Results 1 to 8 of 8

Juxtaposing a column of numbers

  1. #1
    Registered User
    Join Date
    09-03-2009
    Location
    Columbus
    MS-Off Ver
    Excel 2003
    Posts
    6

    Juxtaposing a column of numbers

    Hi,
    I have a row of numbers that need juxtaposed.
    For example: if the number appears as 0051-72
    I need to change it to 72-0051

    The numbers all start with the 2 digits, separated by (-) and then the 4 digits

    so, basically I need to take the last 2 digits and move them to the front separated by the dash.


    all numbers are different...and I have 130,000 to fix.

    is there a simple script or formula I can run on this column?

    Any help would be greatly appreciated.
    Thanks!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Juxtaposing a column of numbers

    =right(a1,2)&"-"&left(a1,4)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    09-03-2009
    Location
    Columbus
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Juxtaposing a column of numbers

    Thanks! I'll give it a go.

  4. #4
    Registered User
    Join Date
    09-03-2009
    Location
    Columbus
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Juxtaposing a column of numbers

    Getting an error:

    Compile error:
    Expected: line number or label or statement or end of statement


    any thoughts? I'll keep playing with it, but have to take off for a bit. I'll check back in.

    thanks!

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Juxtaposing a column of numbers

    thats a function ,put it in a cell and drag down to end of data(assuming your data is in col a). then copy/ paste/ special /values back over the original then delete formula
    Attached Files Attached Files
    Last edited by martindwilson; 09-03-2009 at 05:09 PM.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Juxtaposing a column of numbers

    Another way would be to use this formula

    =MID(A1&"-"&A1,6,7)

  7. #7
    Registered User
    Join Date
    09-03-2009
    Location
    Columbus
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Juxtaposing a column of numbers

    I'm still getting the same error. Should there be additional code that will allow it to loop through all of the cells in a column. Though I can't get either of these codes to even change the first cell without getting the error.

    Thanks for everyone's help. Sorry, I'm not a big excel user.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Juxtaposing a column of numbers

    i said before its not vba put either in a spare column and drag down to end of your data.
    when done simply copy then paste special values which will remove the formula and just leave the results
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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