Formula that return Name according to Max Grade and Age

Israelinas

New Member
Joined
Dec 25, 2016
Messages
25
Hi all,

I need to create a formula that will return the Name and the Favorite Color of a person according to the following:
1) Age = 17
2) Highest grade.


[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Age[/TD]
[TD]Grade[/TD]
[TD]Favorite Color[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]17[/TD]
[TD]99[/TD]
[TD]Blue[/TD]
[/TR]
[TR]
[TD]Stefan[/TD]
[TD]26[/TD]
[TD]99[/TD]
[TD]Red[/TD]
[/TR]
[TR]
[TD]Jake[/TD]
[TD]17[/TD]
[TD]78[/TD]
[TD]Pink[/TD]
[/TR]
[TR]
[TD]Donna[/TD]
[TD]28[/TD]
[TD]98[/TD]
[TD]Green[/TD]
[/TR]
[TR]
[TD]Sam[/TD]
[TD]36[/TD]
[TD]85[/TD]
[TD]Blue[/TD]
[/TR]
[TR]
[TD]Victoria[/TD]
[TD]15[/TD]
[TD]88[/TD]
[TD]Yellow[/TD]
[/TR]
[TR]
[TD]Brenda[/TD]
[TD]22[/TD]
[TD]89[/TD]
[TD]Orange[/TD]
[/TR]
</tbody>[/TABLE]


Many thanks,
Israelinas
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Use the following array formulas

Excel Workbook
ABCDEFGH
1NameAgeGradeFavorite ColorAgeNameFavorite Color
2John1799Blue15VictoriaYellow
3Stefan2699Red
4Jake1578Pink
5Donna2698Green
6Sam1785Blue
7Victoria1588Yellow
8Brenda2689Orange
April


Array formulas
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself
 
Upvote 0
Try

If there is a tie for highest grade then this will return the first match


Book1
ABCD
1NameAgeGradeFavorite Color
2John1799Blue
3Stefan2699Red
4Jake1778Pink
5Donna2898Green
6Sam3685Blue
7Victoria1588Yellow
8Brenda2289Orange
9
10
11age17
12
13namefavorite color
14JohnBlue
Sheet2
Cell Formulas
RangeFormula
A14{=INDEX(A2:A8,SMALL(IF(B2:B8=B11,IF(C2:C8=MAXIFS(C2:C8,B2:B8,B11),ROW(B2:B8)-ROW(B2)+1)),1))}
B14{=INDEX(D2:D8,SMALL(IF(B2:B8=B11,IF(C2:C8=MAXIFS(C2:C8,B2:B8,B11),ROW(B2:B8)-ROW(B2)+1)),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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