IF Statement to find Grade Level

knaimi

New Member
Joined
Jun 23, 2013
Messages
49
Hi all!

Our school require all students to have 23 credits to graduate. For the students to be in 9th grade, they must have less than 6 credits. To be in 10th grade they must have between 6 and 11.99 credits. To be in 11th grade, they must have between 12 and 16.99 credits. To be in 12th grade, they must have 17 or more credits.

The problem is when we receive transferred students who have attended other high schools, their graduation requirement might be higher. So if the transferred student needs 24 credits to graduate then she must have less than 7 credits to be in 9th grade, between 7 and 13.99 to be in 10th grade …etc.

I need to have an if statement to place all students in the right grade level. In excel 2016 sheet I have 17 columns: Column C has the grade level, column N has the total credits the students earned so far, column O has Graduation Requirement (23 or higher). I need to place the If statement in column C to show the correct grade level.

Please see example below:

[TABLE="width: 468"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD]Column C
[/TD]
[TD][/TD]
[TD]Column N
[/TD]
[TD]Column O[/TD]
[/TR]
[TR]
[TD]State ID
[/TD]
[TD]Name
[/TD]
[TD]Grade
[/TD]
[TD][/TD]
[TD]Total Credit
[/TD]
[TD]GradReq[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]10[/TD]
[TD][/TD]
[TD]11.75[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]10[/TD]
[TD][/TD]
[TD]7.5[/TD]
[TD]24[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]12[/TD]
[TD][/TD]
[TD]20.5[/TD]
[TD]24.5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]10[/TD]
[TD][/TD]
[TD]10.65[/TD]
[TD]23.4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD][/TD]
[TD]17.05[/TD]
[TD]23.8[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]9[/TD]
[TD][/TD]
[TD]7.7[/TD]
[TD]24.75[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]12[/TD]
[TD][/TD]
[TD]22.5[/TD]
[TD]27.5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD][/TD]
[TD]20[/TD]
[TD]27[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Do you know VLOOKUP? I would imagine that is a much better (and elegant) solution than having a huge IF statement.

If you don't know VLOOKUP, perhaps I (or someone else) can help but if you do, maybe this will jog your memory :)
 
Last edited:
Upvote 0
Maybe something like this:
Set up a look up table somewhere in your workbook as in cells A13 to B17 in the example below.
Then use the LOOKUP function in cell C2 and copy down column as needed.
Change ranges to match your data and cells that contain your look up table.
Excel Workbook
ABCDMNO
1State IDNameGradeTotal CreditGradReq
21011.7523
3107.524
41220.524.5
51010.6523.4
61117.0523.8
797.724.75
81222.527.5
9112027
10
11
12Look up table
13CreditsGrade
1409
15610
1611.9911
171712
Sheet
 
Upvote 0
AhoyNC's solution is fairly similar to mine, so you might as well use his solution.

You could also set up the lookup table on another worksheet. Just make sure you reference the other worksheet correctly if you do it that way :)

When setting up a lookup table, it is important to start from the lowest value (in this case, the lowest possible mark) and work up, otherwise the lookup function will not work as intended.
 
Last edited:
Upvote 0
It did work. Thanks.

The only concern is that when when any cell in N and O columns were blank, the student was placed in 12th grade. How can I fix it where when those two cells are blank, the student should be placed in 9th grade?

Thanks,
 
Upvote 0
Try:
Also, if you don't want to put a look up table in your workbook you could ud=se the formula in cell E2 of the example.
Excel Workbook
ABCDEFMNO
1State IDNameGradeTotal CreditGradReq
2101011.7523
399
4121220.524.5
5101010.6523.4
6111117.0523.8
7997.724.75
8121222.527.5
911112027
10
11
12Look up table
13CreditsGrade
1409
15610
1611.9911
171712
Sheet
 
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top