# How can I create a "MaxIF" formula?

#### d0rian

##### Active Member
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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

##### MrExcel MVP
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.

Replies
5
Views
65
Replies
0
Views
63
Replies
5
Views
152
Replies
11
Views
261
Replies
8
Views
117

1,127,921
Messages
5,627,631
Members
416,257
Latest member
salomon

### 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.

### Which adblocker are you using?

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

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