# Nesting IF Functions

1. ## 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?

Jon

2. ## 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.

3. ## 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

4. ## 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. ## 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. ## Re: Nesting IF Functions

A shorter formula:
=MATCH(M2, {"Freshman", "Sophomore", "Junior", "Senior"}, 0)

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