+ Reply to Thread
Results 1 to 3 of 3

Insert Hyphen (-) between two words

  1. #1
    Registered User
    Join Date
    11-29-2009
    Location
    dubai
    MS-Off Ver
    Excel 2003
    Posts
    56

    Insert Hyphen (-) between two words

    Hi,

    I have big list of Country and Currency codes. Is there a way to insert a Hyphen (-) between the two words.


    Eg:

    Afghanistan Afghani
    Albanian Lek
    Algerian Dinar
    Andorran Franc
    Andorran Peseta
    Angolan Kwanza


    Thanks
    R

  2. #2
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581

    Re: Insert Hyphen (-) between two words

    Hi,

    Are the words in separate cells on the spreadsheet? If so, you just need to use the following formula:

    PHP Code: 
    =A2&"-"&B2 
    where A2 is the cell with the country and B2 is the cell with the currency.


    If these two pieces of information are in the same cell, you're going to have more difficulties. In general, there will only be one space between the two words, which would make it easy. However, occasionally you'll have a situation where one or the other has more, such as "New Zealand Dollar" or "China Yuan Renminbi". For this reason, there's no systematic way to determine where the dash should go.

    If this is the situation you are in, I would recommend the following formula:

    PHP Code: 
    =IF(LEN(A2)-SUBSTITUTE(A2," ","")>1,"Do Manually",SUBSTITUTE(A2," ","-")) 
    where A2 is the cell that has the country/currency information.

    In this formula, it would do all the easy ones. You would then have to go through and look at the "Do Manually" ones and make the determination for yourself.

    S

  3. #3
    Registered User
    Join Date
    11-29-2009
    Location
    dubai
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Insert Hyphen (-) between two words

    thank you so much.

+ 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