+ Reply to Thread
Results 1 to 6 of 6

Using the condition of the 4th character in the cell to produce 1 of 4 possible outcomes

  1. #1
    Registered User
    Join Date
    05-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    8

    Using the condition of the 4th character in the cell to produce 1 of 4 possible outcomes

    Dear all,

    I am looking at using module code to generate module type in a separate column.

    For e.g., module code AR2101 has the 4th character 1, which corresponds to a core module. 4th character 2 would correspond to an elective module, 3 an enrichment module, 4 an extra credit module.

    Would you be able to suggest which functions I should use?

    Thanks
    Last edited by Ruthie83; 05-16-2013 at 10:42 PM.

  2. #2
    Registered User
    Join Date
    05-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Using the condition of the 4th character in the cell to produce 1 of 4 possible outcom

    This is what I tried but it didn't work!

    =LOOKUP(MID(E2,4,1),"1","2","3","4", Core, Elective, Enrichment, Extra Credit)

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using the condition of the 4th character in the cell to produce 1 of 4 possible outcom

    Try it like this:

    =LOOKUP(MID(E2,4,1),{"1","2","3","4"},{"Core","Elective","Enrichment","Extra Credit"})
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    05-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Using the condition of the 4th character in the cell to produce 1 of 4 possible outcom

    Thanks! That worked brilliantly.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using the condition of the 4th character in the cell to produce 1 of 4 possible outcom

    We can save a couple of keystrokes with this version:

    =LOOKUP(--MID(E2,4,1),{1,2,3,4},{"Core","Elective","Enrichment","Extra Credit"})

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using the condition of the 4th character in the cell to produce 1 of 4 possible outcom

    You're welcome!

+ 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