If statement with grades

rwmill9716

Active Member
Joined
May 20, 2006
Messages
493
Office Version
  1. 2013
Platform
  1. Windows
I need an IF statement that keys off grades of C- to A+. Something like this: IF(B1>="C-",A1,""). I know that statement doesn't work, while using a series of OR statements does, but I wondered if there was something simpler than the OR statement approach which uses 9 substatements, e.g., OR(B1="C-",B1="C", etc).
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Something like this.


Excel 2013/2016
AB
1DataRemarks
210C-
Sheet10
Cell Formulas
RangeFormula
B2=IF(OR(A2<=10,A2<=15),"C-",IF(OR(A2<=20,A2<=25),"C",IF(OR(A2<=30,A2<=35),"B-",IF(OR(A2<=40, A2<=45),"B",IF(OR(A2<=50, A2<=55),"A-",IF(OR(A2<=60, A2<=100),"A+","-"))))))
 
Upvote 0
Thanks, Sam_D_Ben,

This is not exactly what I was looking for. Assume your col A had a list of names and Col B a list of grades. I want names in Col C that had a grade of C- or better. I know that I can do this with a series of OR statements (and I set it up that way), but I wondered if there was a simplier IF statement, like IF(B2>="C-",A2,"") for Cell C2.
 
Upvote 0
Maybe

Book1
ABC
1NameGrade
2Tom PearceATom Pearce
3Bill BrewerDPeter Gurney
4Jan StewerFDan'l Whiddon
5Peter GurneyC-Harry Hawke
6Peter DavyD+Tom Cobbley
7Dan'l WhiddonC+
8Harry HawkeA-
9Tom CobbleyB+
End
Cell Formulas
RangeFormula
C2=IFERROR(INDEX($A$2:$A$9,AGGREGATE(15,6,(ROW($A$2:$A$9)-ROW($A$2)+1)/($B$2:$B$9<="C+"),ROWS($1:1))),"")
 
Upvote 0
Have you tried filtering it? Just select column B, click the filter button, then check all the A, B, and C boxes.

If you want a formula, here are 2 options:

Excel 2012
ABCDEFG
1NameGradePassersScore above:B-Grades
2AmyAAmyBobF
3BobB-BobEricaD-
4ClaireC-ClaireFredD+
5DanDEricaIreneD+
6EricaA+FredKellyC-
7FredB+HalC
8GingerFIreneC+
9HalC-KellyB-
10IreneB+B
11JackFB+
12KellyA-A-
13A
14A+

<tbody>
</tbody>
Sheet1


Worksheet Formulas
CellFormula
C2=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/(LEFT($B$2:$B$20)={"A","B","C"}),ROWS($C$2:$C2))),"")
D2=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/(MATCH($B$2:$B$20,$G$2:$G$14,0)>=MATCH($E$1,$G$2:$G$14,0)),ROWS($C$2:$C2))),"")

<tbody>
</tbody>

<tbody>
</tbody>



The first has the A, B, or C hardcoded in the formula (following +/- sign ignored). The second lets you put an arbitrary grade in E1, and selects the grades that are higher in the grade list in column G.
 
Last edited:
Upvote 0
Maybe

Book1
ABC
1NameGrade
2Tom PearceATom Pearce
3Bill BrewerDPeter Gurney
4Jan StewerFDan'l Whiddon
5Peter GurneyC-Harry Hawke
6Peter DavyD+Tom Cobbley
7Dan'l WhiddonC+
8Harry HawkeA-
9Tom CobbleyB+
End
Cell Formulas
RangeFormula
C2=IFERROR(INDEX($A$2:$A$9,AGGREGATE(15,6,(ROW($A$2:$A$9)-ROW($A$2)+1)/($B$2:$B$9<="C+"),ROWS($1:1))),"")

Assuming Fluff's layout, here is an array-entered** formula that you can use...

=IFERROR(INDEX(A:A,SMALL(IF(B$2:B$9<"D",ROW(B$2:B$9)),ROWS(C$1:C1))),"")

**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself.
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,857
Members
449,051
Latest member
excelquestion515

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