Find a value in a specific column based on two values/criteria from multiple columns? (match/index/lookup)

perola.rike

Board Regular
Joined
Nov 10, 2011
Messages
151
I have 3 columns with Age in the top row (11, 12, 13 years), in the rows below I have the possible results from a test (1-6, 2-7 and 3-8). The far right column contains the grades that correspond to the results for each age group/column.

I need a formula that based on AGE and RESULT finds the GRADE
If a 11 year old get the result of 1, the grade will be an A.
I have tried for many hours with all sorts of match/index/lookup formulas with no luck...I can't put the loose formulas into a functional one that get the grades based on age/result...

Any suggestions?


age111213grade
123a
234b
345c
456d
567e
678f

<tbody>
</tbody>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Formula in D10

Code:
=INDEX($E$2:$E$7,MATCH($C$10,INDEX($B$2:$D$7,0,MATCH($B$10,$B$1:$D$1,0)),0))

A
B
C
D
E
1
age
11
12
13
grade
2
1
2
3
a
3
2
3
4
b
4
3
4
5
c
5
4
5
6
d
6
5
6
7
e
7
6
7
8
f
8
9
Age
Result
Grade
10
12
4
c

<tbody>
</tbody>
 
Upvote 0
One additional question:
I will use this formula for other tables/matrixes where the age variable are ranges (see table below), not specific values. Any tips how to get the formula to work on ranges (not exact match). I've tried to modify the formula from this:
=INDEX($E$2:$E$7,MATCH($C$10,INDEX($B$2:$D$7,0,MATCH($B$10,$B$1:$D$1,0)),0))


to this:

=INDEX($E$2:$E$7,MATCH($C$10,INDEX($B$2:$D$7,0,MATCH($B$10,$B$1:$D$1,1)),0))
but it wont work...

ABCDE
1age10-1516-2021-25grade
2123a
3234b
4345c
5456d
6567e
7678f
8
9AgeResultGrade
10124c

<tbody>
</tbody>
 
Upvote 0
You could add another cell and use a VLOOKUP to find the age range for the MATCH, or if you don't want to add another cell you could put the VLOOKUP into the MATCH formula (see cell E11). I hard coded the VLOOKUP table into the formula, but if you would be adding or changing age ranges it would probably be better to to set up a table somewhere in your workbook that could be easily changed.
Excel Workbook
ABCDE
1age10-1516-2021-25grade
2*123a
3*234b
4*345c
5*456d
6*567e
7*678f
8*****
9*AgeAge RangeResultGrade
10*1816-204c
11****c
Sheet
 
Upvote 0
Wow, thanks! I'll modify your suggestions to fit my use. My tables are larger Grades/age example, and your formulas will certainly make it quite easy to apply this to matrixes with many columns and rows. And easy to maintain!
 
Upvote 0

Forum statistics

Threads
1,215,647
Messages
6,126,006
Members
449,280
Latest member
Miahr

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