+ Reply to Thread
Results 1 to 5 of 5

Enter DASH after TRIM

  1. #1
    Registered User
    Join Date
    06-12-2009
    Location
    virginia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Enter DASH after TRIM

    Hello:
    I have this in a cell:
    13 2

    I used the TRIM command and made it:

    13 2



    But now I need to add a dash between the 13 and the 2, so that it will look like this : 13-2


    i have over 1,000 parcels to do this to.

    Please tell me how to do it, I need it asap. I dont know what the command/formula is after I have trimmed it.. Thanks !!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,679

    re: Enter DASH after TRIM

    Welcome to the forum.

    We don't do ASAP -- if you need help ASAP, please post in the Commercial Services forum.

    =SUBSTITUTE(TRIM(A1)," ","-")
    Last edited by shg; 06-12-2009 at 02:15 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-12-2009
    Location
    virginia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Enter DASH after TRIM

    My friend, sorry for the ASAp
    That is working , the substitue thing, but there is ONE problem.

    say I have 13 2 (portion of)

    It is making it look like:
    13-2(portion-of)

    So now the dash is going between the "portion" and "of"

    is there a way to negate the dash if it comes between letters?
    thank you SOOOOOOOOOO MUCH!!!!!!!!!!!!!!!

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Enter DASH after TRIM

    You'll get the best answers if you give all the information up from (all possible iterations). Will the number always come first? Is the phrase always the same? always in parentheses? Anything else?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  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: Enter DASH after TRIM

    for your specific example
    =SUBSTITUTE(TRIM(A1)," ","-",1)
    but i bet there are others with slighly different needs just as chemistb says
    "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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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