Return a Value Based on a Range Criteria AND a String Match Criteria

blast0

New Member
Joined
May 15, 2019
Messages
2
I have scoured the internet and I cannot find anyone trying to do specifically what I am doing in Excel, so hopefully you can help.

Consider the following table (Range"A1:D16"):

College

<tbody>
</tbody>
Score Range Min

<tbody>
</tbody>
Score Range Max

<tbody>
</tbody>
Letter Grade

<tbody>
</tbody>

<tbody>
</tbody>
Rutgers

<tbody>
</tbody>
0

<tbody>
</tbody>
60

<tbody>
</tbody>
F

<tbody>
</tbody>
Rutgers

<tbody>
</tbody>
61

<tbody>
</tbody>
70

<tbody>
</tbody>
D

<tbody>
</tbody>
Rutgers

<tbody>
</tbody>
71

<tbody>
</tbody>
80

<tbody>
</tbody>
C

<tbody>
</tbody>
Rutgers

<tbody>
</tbody>
81

<tbody>
</tbody>
90

<tbody>
</tbody>
B

<tbody>
</tbody>
Rutgers

<tbody>
</tbody>
91

<tbody>
</tbody>
100

<tbody>
</tbody>
A

<tbody>
</tbody>
Princeton

<tbody>
</tbody>

<tbody>
</tbody>
0

<tbody>
</tbody>
80

<tbody>
</tbody>
F

<tbody>
</tbody>
Princeton

<tbody>
</tbody>

<tbody>
</tbody>
81

<tbody>
</tbody>
85

<tbody>
</tbody>
D

<tbody>
</tbody>
Princeton

<tbody>
</tbody>

<tbody>
</tbody>
86

<tbody>
</tbody>
90

<tbody>
</tbody>
C

<tbody>
</tbody>
Princeton

<tbody>
</tbody>

<tbody>
</tbody>
91

<tbody>
</tbody>
95

<tbody>
</tbody>
B

<tbody>
</tbody>
Princeton

<tbody>
</tbody>

<tbody>
</tbody>
96

<tbody>
</tbody>
100

<tbody>
</tbody>
A

<tbody>
</tbody>
Monmouth

<tbody>
</tbody>

<tbody>
</tbody>
0

<tbody>
</tbody>
40

<tbody>
</tbody>
F

<tbody>
</tbody>
Monmouth

<tbody>
</tbody>

<tbody>
</tbody>
41

<tbody>
</tbody>
55

<tbody>
</tbody>
D

<tbody>
</tbody>
Monmouth

<tbody>
</tbody>

<tbody>
</tbody>
56

<tbody>
</tbody>
70

<tbody>
</tbody>
C

<tbody>
</tbody>
Monmouth

<tbody>
</tbody>

<tbody>
</tbody>
71

<tbody>
</tbody>
85

<tbody>
</tbody>
B

<tbody>
</tbody>
Monmouth

<tbody>
</tbody>

<tbody>
</tbody>
86

<tbody>
</tbody>
100

<tbody>
</tbody>
A

<tbody>
</tbody>

<tbody>
</tbody>

I want to be able to input a College into column "F", input a Score into column "G", and have an excel formula in Column "H" tell me the letter grade.

My expected results are as follows(Range"F1:H4"):

Score

<tbody>
</tbody>
College

<tbody>
</tbody>
Letter Grade

<tbody>
</tbody>
79RutgersC
79PrincetonF
79MonmouthB

<tbody>
</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
So I have come up with the following solution, please consider for cell H2:
{=IFERROR(INDEX(D2:D16,MATCH(1,(A2:A16=F2)*(B2:B16<=G2)*(C2:C16>=G2),0)),"")}

The problem I think I am having now is that in the real world I have a thousands of rows of schools and grade ranges, and I have thousands of rows of test data to validate, and Excel is not responding. Any help would be greatly appreciated.
 
Upvote 0
Not sure if it will be any better, but a non array formula


Excel 2013/2016
ABCDEFGH
1CollegeScore Range MinScore Range MaxLetter GradeScoreCollegeLetter Grade
2Rutgers060F79RutgersC
3Rutgers6170D79PrincetonF
4Rutgers7180C79MonmouthB
5Rutgers8190B
6Rutgers91100A
7Princeton080F
8Princeton8185D
9Princeton8690C
10Princeton9195B
11Princeton96100A
12Monmouth040F
13Monmouth4155D
14Monmouth5670C
15Monmouth7185B
16Monmouth86100A
Data
Cell Formulas
RangeFormula
H2=IFERROR(INDEX($D$2:$D$16,AGGREGATE(15,6,(ROW($D$2:$D$16)-ROW($D$2)+1)/(($A$2:$A$16=G2)*($B$2:$B$16<=F2)*($C$2:$C$16>=F2)),1)),"")
 
Upvote 0
Hi
Welcome to the board

Another option, in H2:

=LOOKUP(F2,$B$2:$B$16/($A$2:$A$16=G2),$D$2:$D$16)

I assumed that, like in your example, for each college the Range Min's are in ascending order.
I don't need the Range Max's.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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