+ Reply to Thread
Results 1 to 5 of 5

Replacing short strings

  1. #1
    Registered User
    Join Date
    07-28-2008
    Location
    London
    Posts
    4

    Replacing short strings

    Hi,

    I have a long list of locations in an excel spreadsheet, stating either the country (eg India) or for US locations the state (in a two letter format, eg NY). I need to change all the state location to say "USA". How can I do this, without doing 50 find and replaces?

    Can I do something based around the fact all the USA locations are two letters, whereas all the others are longer?

    Apologies if this has been asked before, if so could you point me in the right direction.

    Thanks,
    Jamie
    Last edited by oldchippy; 05-04-2009 at 09:40 AM.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    May be something like this will help?

    =IF(LEN(A1)=2,"USA",A1) copy down
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Find and Replace

    One option is:

    Column A is the old list
    Column B is where this formula goes (new list)
    Column C is the state list
    =IF(ISNUMBER(MATCH(A1,$C$1:$C$53,0)),"USA",A1)

    HTH
    Ola

  4. #4
    Registered User
    Join Date
    07-28-2008
    Location
    London
    Posts
    4
    brilliant, thanks.

    Sorry for asking such seemingly obvious questions, but I'm still learning...

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Replacing short strings

    try this (as you'll see....much easier to do than to describe):

    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ 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