+ Reply to Thread
Results 1 to 4 of 4

Thread: Nesting IF statements using alphanumeric cell contents

  1. #1
    Registered User
    Join Date
    01-04-2012
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Nesting IF statements using alphanumeric cell contents

    My spreadsheet has a column of employee numbers that is alphanumeric. The numeric portion tells me which location they belong to. I need to develop a formula that will read the numeric portion of a cell and assign a location code so I can then sort it. I believe none of the formulas I have tried work correctly because the locations are numeric. I have included a table of locations if that helps. The result should convert the numeric portion of the employee to the alpha location code listed in the table.
    In other words, the employee listed on row two has a location of 1250 in cell B2. In cell F2, the result should be "T". The formula in column F does not give me the correct answer.
    Sure would appreciate some help!
    Attached Files Attached Files
    Last edited by DianeP; 01-05-2012 at 11:39 AM.

  2. #2
    Valued Forum Contributor tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2003 - 2007
    Posts
    2,352

    Re: Nesting IF statements using alphanumeric cell contents

    DianeP,

    Attached is a modified version of your example workbook. I reformatted the table layout to be excel friendly. Then, in cell F2 I used this formula:
    =VLOOKUP(LOOKUP(9E+300,--LEFT(A2,ROW($A$1:INDEX(A:A,LEN(A2))))),$I$2:$J$37,2,FALSE)

    And copied down.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

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

  3. #3
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Nesting IF statements using alphanumeric cell contents

    Another way is,

    Convert the table I3:N17 to a valid numbers, the use this formula in E2,

    =IFERROR(INDEX(I$2:N$2,SMALL(IF($I$3:$N$17=LOOKUP(9E300,--LEFT(B2,ROW(A$1:A$20))),COLUMN($I2:$N2)-COLUMN($I2)+1),1)),"")

    Confirmed with CTRL+SHIFT+ENTER, then copy down.
    Attached Files Attached Files
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  4. #4
    Registered User
    Join Date
    01-04-2012
    Location
    Virginia Beach, VA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Nesting IF statements using alphanumeric cell contents

    Two very interesting solutions to this problem that both work perfectly! I was not very familiar with either of these types of formulas and have now done some research to help me understand. Thank you both so much for your help.

+ 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.2.0