+ Reply to Thread
Results 1 to 6 of 6

Nesting IF Functions

  1. #1
    Registered User
    Join Date
    08-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Question Nesting IF Functions

    Hello,

    I have to classify students by year in college. At the moment, next to their name is states their year but I need this to be display as a numeric value. I am attempting to nest IF functions to help me solve this task. As of now, my function looks like this....

    =IF(M2=Freshman,1,IF(M2=Sophomore,2,IF(M2=Junior,3,IF(M2=Senior,4,0))))

    This equation doesn't give me anything, not even an error. It simply displays in the cell as the written formula.

    Can someone please help me proof this equation or create a new equation that would serve the same purpose?

    Thanks in advance for your time!

    Jon

  2. #2
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Nesting IF Functions

    First, the text must be surrounded with quotes:

    Please Login or Register  to view this content.
    Second, if the formula shows up instead of the result, then you probably have the cell formatted as text.
    Docendo discimus.

  3. #3
    Registered User
    Join Date
    08-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Nesting IF Functions

    Thanks for the help, I fixed the quotes and you were right, it was set as text. But, I set it to General and it still doesn't give me a number, just the equation. Any other ideas?

    EDIT***** Correction, I got it to spit out the negative result (0). But now it will not identify the Sophomore that is in M2
    Last edited by jon711b; 08-11-2012 at 03:25 PM.

  4. #4
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Nesting IF Functions

    You'll have to click into the formula bar (formula edit mode), then click the green (well, it used to be green) check mark to make the formula react to the format change.

  5. #5
    Registered User
    Join Date
    08-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Nesting IF Functions

    Figured it out. Sorry for the confusion, I made a dumb mistake. Everything that you said worked and was much needed information but I deleted preceding columns, so Sophomore was in column J now.

    Thanks again for the help!

  6. #6
    Forum Guru mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,204

    Re: Nesting IF Functions

    A shorter formula:
    =MATCH(M2, {"Freshman", "Sophomore", "Junior", "Senior"}, 0)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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