Get value from a range based on maximum

krllb

New Member
Joined
Jun 10, 2013
Messages
18
Hi Gurus,

Newbie questions. How can I get value "Yellow" from a range based on this criteria. If bird is entered then it will get the maximum value in column A which is yelllow.
Many thanks in advance.

1720690518562.png


Regards,
Krll
 

Attachments

  • 1720690480602.png
    1720690480602.png
    9.6 KB · Views: 3

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
try

Excel Formula:
=INDEX(C2:C10,MATCH(1,(B2:B10=E2)*(A2:A10=MAX(A2:A10)),0))
 
Last edited:
Upvote 0
This may be clunky, but works. You need to adjust the ROW() part of the formula depending on where your first row of data is.
This should work regardless of the sort order.
It requires that you have a version of excel with the MAXIFS function.(please update your profile so the version shows on your button).

Book1
ABCDEF
1ENTRY:Color of Max
22dogredbirdgreen
31dogblue
42Birdgreen
51Birdyellow
Sheet6
Cell Formulas
RangeFormula
F2F2=INDEX($C$2:$C$5,MAX((ROW($A$2:$A$5)-1)*((($B$2:$B$5=E2)*($A$2:$A$5))=(MAXIFS($A$2:$A$5,$B$2:$B$5,E2)))))
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have 365 another option is
Excel Formula:
=TAKE(SORT(FILTER(A2:C100,B2:B100=E2),1,-1),1,-1)
 
Upvote 0
MAXIFS is also only in 365 and 2019 and later versions, it seems.
If you don't have these then try this, it is similar to what @SunnyAlv suggested, but allows for the data to not be sorted:

Excel Formula:
=INDEX($C$2:$C$5,MATCH(TRUE,MAX((($B$2:$B$5=E2)*($A$2:$A$5))*($B$2:$B$5=E2))=(($B$2:$B$5=E2)*($A$2:$A$5))*($B$2:$B$5=E2),0))
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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