How can I create a "MaxIF" formula?

d0rian

Active Member
Joined
May 30, 2015
Messages
261
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
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,554
Messages
5,596,814
Members
414,104
Latest member
imamalidadashzada

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