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"):

[TABLE="width: 500"]
<tbody>[TR]
[TD]

<tbody>
[TD="class: xl65"]College[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109"]Score Range Min[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65"]Score Range Max[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65"][TABLE="width: 44"]
<tbody>[TR]
[TD="width: 44"]Letter Grade[/TD]

</tbody>
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"]Rutgers[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]0[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]60[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]F[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"]Rutgers[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]70[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]D[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]Rutgers[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]71[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]80[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65"]C[/TD]

</tbody>
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"]Rutgers[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]81[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]90[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]B[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"]Rutgers[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]91[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]100[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65"]A[/TD]

</tbody>
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]

<tbody>
[TD="class: xl65"]Princeton[/TD]

</tbody>
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]80[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65"]F[/TD]

</tbody>
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"]

<tbody>
[TD="class: xl65"]Princeton[/TD]

</tbody>
[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]81[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]85[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]D[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"]

<tbody>
[TD="class: xl65"]Princeton[/TD]

</tbody>
[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]86[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]90[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65"]C[/TD]

</tbody>
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]Princeton[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]91[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]95[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]B[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]Princeton[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]96[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]100[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65"]A[/TD]

</tbody>
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]

<tbody>
[TD="class: xl65"]Monmouth[/TD]

</tbody>
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]40[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]F[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]Monmouth[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]41[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]55[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]D[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"]

<tbody>
[TD="class: xl65"]Monmouth[/TD]

</tbody>
[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]56[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]70[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]C[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]

<tbody>
[TD="class: xl65"][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]Monmouth[/TD]

</tbody>
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl65, width: 109, align: right"]71[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 115"]
<tbody>[TR]
[TD="class: xl65, width: 115, align: right"]85[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]B[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="class: xl65, width: 76"]

<tbody>
[TD="class: xl65"]Monmouth[/TD]

</tbody>
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]86[/TD]

</tbody>
[/TD]
[TD]

<tbody>
[TD="class: xl65, align: right"]100[/TD]

</tbody>
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="class: xl65, width: 44"]A[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

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"):

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 41"]
<tbody>[TR]
[TD="width: 41"]Score[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR]
[TD="width: 76"]College[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 44"]
<tbody>[TR]
[TD="width: 44"]Letter Grade[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]79[/TD]
[TD]Rutgers[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]79[/TD]
[TD]Princeton[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]79[/TD]
[TD]Monmouth[/TD]
[TD]B[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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