+ Reply to Thread
Results 1 to 10 of 10

Formula not working to convert state names to abbreviations

  1. #1
    Registered User
    Join Date
    06-30-2014
    Location
    MT
    MS-Off Ver
    2013
    Posts
    5

    Formula not working to convert state names to abbreviations

    I have been at this all night and no matter what formula I type in I get "The Formula Contains Errors"

    In Column 'E' I have a list of states spelled out, I would like to change that to the state abbreviations.

    In column 'H' I have the states and in column 'I' the abbreviations.

    I am trying to put my formula into column 'F'

    I have tried several different formulas found on-line in various forums and I have also tried using a separate sheet.

    No matter what formula I use I get the same error in both Excel 2013 and Excel 2003.

    Can someone please talk me through this step by step as if I had no clue what I am doing, because after 3 hours of messing around with this, I apparently do not have a clue!

  2. #2
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Formula not working to convert state names to abbreviations

    =index($I$1:$I52,match(E1,$H$1:$H$52,0))

    If that does not work you may want to post a quick example so we can see what might be throwing an error.
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula not working to convert state names to abbreviations

    I think a VLookup will do.

    But you get better help if you add your excel file, without confidential information, on this forum.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    06-30-2014
    Location
    MT
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula not working to convert state names to abbreviations

    Every formula that uses vlookup has failed

    Here is my file without the confidential info.

    I will =index formula in a moment.

    There is currently no formula in file because I could not get any of them to work.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-30-2014
    Location
    MT
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula not working to convert state names to abbreviations

    =index($I$1:$I52,match(E1,$H$1:$H$52,0)) did not work. I can not attach the sample as when I try to save I get the bad formula error.

  6. #6
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Formula not working to convert state names to abbreviations

    The formula I provided works if you start it in F1, otherwise change the Match(E1 to Match(E2 and start it in F2.

    If you prefer vlookup use =VLOOKUP(E2,$H$2:$I$50,2)
    Attached Files Attached Files
    Last edited by Hawkeye16; 06-30-2014 at 04:02 AM.

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula not working to convert state names to abbreviations

    f2
    Please Login or Register  to view this content.
    and drag down

  8. #8
    Registered User
    Join Date
    06-30-2014
    Location
    MT
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula not working to convert state names to abbreviations

    I'm not sure what I am doing wrong, but I did use your formula as follows in F2:

    =index($I$1:$I52,match(E2,$H$1:$H$52,0))

    I also just tried pasting the new formula into F2 and the error pops up as soon as I enter.

    Maybe a screenshot will help?
    Attached Images Attached Images

  9. #9
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Formula not working to convert state names to abbreviations

    Did you take a look at the file I attached? It has both ways of doing it in there.

    In Holland we need to use ; instead of , due to currency conventions, otherwise I can't readily see an error in your formula (aside from starting at H2 instead of H1 but that would not cause an error).

    Try looking at the file I attached and see what the formulas say.
    Last edited by Hawkeye16; 06-30-2014 at 04:12 AM.

  10. #10
    Registered User
    Join Date
    06-30-2014
    Location
    MT
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula not working to convert state names to abbreviations

    Quote Originally Posted by Hawkeye16 View Post
    Did you take a look at the file I attached? It has both ways of doing it in there.

    In Holland we need to use ; instead of , due to currency conventions, otherwise I can't readily see an error in your formula (aside from starting at H2 instead of H1 but that would not cause an error).

    Try looking at the file I attached and see what the formulas say.
    No I did not see you attached it!!!!

    I just opened it, pasted your code over mine and worked!!!!!

    I wonder why every other code I tried threw that error.

    Thank you SO much you are truly a life saver.

+ 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. [SOLVED] Parsing list of state names and abbreviations
    By Aceso in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2013, 08:40 AM
  2. Replies: 3
    Last Post: 02-10-2012, 09:19 PM
  3. Lookup up state abbreviations
    By Chakon in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-04-2009, 02:16 PM
  4. Convert State Names to Abbreviations
    By fgrayson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2008, 03:54 AM
  5. [SOLVED] US State Abbreviations List
    By DTTODGG in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-16-2005, 09:40 AM

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