+ Reply to Thread
Results 1 to 5 of 5

Other option than IF function

  1. #1
    Registered User
    Join Date
    04-01-2011
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2002
    Posts
    10

    Other option than IF function

    I have one cell on the left, let's say B2, which can hold any of 23 different symbols -- let's say "A" or "B" or "C" etc., all the way through "W." Then, I have one cell on the right, let's say C2, which I'd like to be a numerical value, based on the symbol that is entered into B2.
    So, let's say "A" in B2 should create a value of "1" in C2; "B" in B2 should create a value of "2" in "C2", etc.
    How do I do this?
    I've tried =IF(B2="A",1,IF(B2="B",2,IF(B2="C",3,etc.))), but the IF function only allows 7 alternatives, and I need 23.
    Any ideas?
    Thanks in advance!

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Other option than IF function

    Hi rburk
    Welcome to the forum
    one way is with Lookup

    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    03-24-2011
    Location
    Bristol
    MS-Off Ver
    Excel 2000
    Posts
    36

    Re: Other option than IF function

    Hi as well

    =code(B1)-96
    will work also

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Other option than IF function

    I think you mean:

    =CODE(B2)-64

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Other option than IF function

    I think the OP was only using letters as an example. Lookup will work, or you can set up a table Code in Col 1 and expected return in col 2. You can use a Defined name or refer to the table directly. So if the table (minus headings) is in F2:G24

    = VLOOKUP(B2, $F$2:$G$24,2,FALSE) will return your numerical value

    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

+ 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