How can I create a "MaxIF" formula?

d0rian

Active Member
Joined
May 30, 2015
Messages
305
Office Version
  1. 2007
Should be simple, but I'm banging my head against the wall. If I have the below data in cells A1:B9, how do I pull the max B-column value for each A-column category. E.g. I want to ask "Considering ONLY the rows with JAN in the A-column, what's the max value in the B-column?" (So formula would return: 30 for Jan, 5 for Feb, 27 for Mar, and 8 for Apr)

Jan 1
Jan 8
Feb 5
Mar 13
Jan 7
Mar 27
Feb 1
Apr 8
Jan 30
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
1) use a pivot table, set to show top n, with n=1

2) formula of the form:

max(if(range=value,number_range))

so something like:

max(if(a1:a9="Jan",b1:b9))
...entered with control + shift + enter, not just enter.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,531
Messages
5,854,284
Members
431,636
Latest member
shabbas313

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
Top