+ Reply to Thread
Results 1 to 8 of 8

Replacing words in a sentence in an Excel Cell with abbreviations

  1. #1
    Registered User
    Join Date
    05-10-2014
    MS-Off Ver
    Excel 2003
    Posts
    22

    Replacing words in a sentence in an Excel Cell with abbreviations

    How could I replace words in a sentence in an Excel Cell with abbreviations.

    ex:

    Cell A1 = California license plates are nicer than a Wyoming plate.

    Abbreviation list:

    California | CA
    Wyoming | WY

    I would like to make a new cell show the corrected sentence as:

    CA license plates are nicer than a WY plate.

    Can this be done with a formula(s) and no VBA? If so, how?

  2. #2
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Replacing words in a sentence in an Excel Cell with abbreviations

    Hi

    Use find and select on the home menu to replace "California with CA then replace Wyoming as WY. I assume you need to change many cells with several alternative spelling. To make several changes select more cells.
    Hope this helps

    Cheers

  3. #3
    Registered User
    Join Date
    05-10-2014
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Replacing words in a sentence in an Excel Cell with abbreviations

    Quote Originally Posted by FoxSeaLady View Post
    Hi

    Use find and select on the home menu to replace "California with CA then replace Wyoming as WY. I assume you need to change many cells with several alternative spelling. To make several changes select more cells.
    Hope this helps

    Cheers
    Thanks for the quick reply. I should've put this in my original post. I know how to use CTRL+F Find and replace. this is not going to be for a one off scenario. I need to have it so that it translates any sentence i copy and paste into say Cell A1, and makes the sentence show the abbreviations for certain words in lets say Cell B1. Which is why I need a formula of some type.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Replacing words in a sentence in an Excel Cell with abbreviations

    I think this can be done with formulas but you need a list of states. You can copy states list from this link
    http://www.softschools.com/social_st...abbreviations/

    Enter first formula in B2 and drag formula across to cell C2 and drag down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Enter the second formula in D2 and drag formula across to cell E2 and drag down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Please see attached file
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Replacing words in a sentence in an Excel Cell with abbreviations

    Try the attached. With sentence in A1, a lookup table of states and abbreviations in K:L enter this formula in B1 and fill across until replacements are completed.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Replacing words in a sentence in an Excel Cell with abbreviations

    Actually you can enter this in B1 and fill across until you get blanks.

    =LOOKUP("zzzzzz",CHOOSE({1,2},"",SUBSTITUTE(A1,LOOKUP(1E+306,FIND($K$1:$K$50,A1),$K$1:$K$50),LOOKUP(1E+306,FIND($K$1:$K$50,A1),$L$1:$L$50))))

  7. #7
    Registered User
    Join Date
    05-10-2014
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Replacing words in a sentence in an Excel Cell with abbreviations

    Quote Originally Posted by FlameRetired View Post
    Try the attached. With sentence in A1, a lookup table of states and abbreviations in K:L enter this formula in B1 and fill across until replacements are completed.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thats it. It was Substitute. That's what I was missing. Question, how is it that the formula knows to change from A1 to say A3 if I delete that first A1 cell and type a sentence in A3? Thank you.

    Wait I spoke to soon. I've noticed it seems to only be able to take 2 words and abbreviate those 2 at a time. anymore than that, and it will not abbreviate the first word.

    For example. I type: California, Texas . It responds: CA, TX (which is correct)

    now if i type: California, Texas, New Hampshire It responds: California, TX, NH (which is incorrect since California is not abbreviated.)

    I need something where it wont matter how many states i want to use in my sentence in order for it to abbreviate them correctly.

    Is that possible with a formula?

    Or is that your point on your last reply where you say drag to the right until blank. OR I would need to drag so far to the right to the point of me having as many formula cells as I do words that could possibly be abbreviated(from my abbreviation list/legend)?
    Last edited by kingpnp; 11-15-2017 at 08:20 PM.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Replacing words in a sentence in an Excel Cell with abbreviations

    Or is that your point on your last reply where you say drag to the right until blank. OR I would need to drag so far to the right to the point of me having as many formula cells as I do words that could possibly be abbreviated(from my abbreviation list/legend)?
    Yes. If you drag the formula far enough to the right it will complete the job.

    If you think that approach might exhaust the list or if you prefer a single formula that will likely require some VBA ... a user defined function.

    BTW: "California, Texas, New Hampshire" worked at my end.

+ 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. Replacing Abbreviations in Street Addresses
    By stcanary in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 03-12-2022, 11:33 AM
  2. [SOLVED] Removing 'stop words' from a sentence in excel
    By shashankbansal in forum Excel General
    Replies: 8
    Last Post: 06-20-2016, 11:32 PM
  3. Replies: 4
    Last Post: 04-27-2012, 06:38 AM
  4. Replacing Abbreviations in Street Addresses
    By belltt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2012, 07:58 PM
  5. Abbreviations to full Words
    By sparky101747 in forum Excel General
    Replies: 4
    Last Post: 02-08-2011, 03:40 PM
  6. Replies: 2
    Last Post: 05-18-2010, 07:55 AM
  7. [SOLVED] Replace a long list of abbreviations with full words in Excel
    By jgundel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-07-2006, 03:15 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