Skip to main content

How to find max or min value in a group in Excel?

Author: Sun Last Modified: 2014-09-02

Generally, finding the max or min value in a range may be easy for most of Excel users, but how about finding the max or min value in each group? Here this tutorial is talking about the tricks to find the max or min value in a group in Excel.

Finding max value in a group with formula

Finding max/min value in a group by applying pivot table

arrow blue right bubble Finding max value in a group with formula

If the data entered in Excel is showed as below (the value is entered in ascending order), you can use a formula to find the last value in each group and then filter it.


1. Type this formula =IF(A2=A3,"","1") ( A2 and A3 are in a group) into the cell C2 which is adjacent to your data, and then press Enter key and drag Auto fill to copy the formula to the range you need. See screenshot:


2. Select C1:C12 and click Data > Filter to add Filter button into Cell C1. See screenshot:


3. Click the Filter button, and check 1 only in the list, and click OK. See screenshot:


Now you can see only the max value in each group is shown.



1. You can delete the filter column (Column C) if you do not need it any more.

2. This way only can find the max value.

3. The data mush be sorted in ascending order in each group.

arrow blue right bubble Finding max/min value in a group by applying pivot table

There is another way that can quickly find the max or min value in each group by inserting a pivot table.

1. Select the data range, and then click Insert > Pivot Table > Pivot Table. See screenshot:


2. Check New Worksheet option, or check Existing Worksheet option and select a cell to place the pivot table, then click OK. See screenshot:


3. Go to the PivotTable Fields List pane at the right side, drag Products to Row Labels, and Sales to Values. See screenshot:


4. Then go to the pivot table and double click Sum of Sales to open Value Field Settings dialog, and select Max or Min from the Summarize value field by list under Summarize Values By tab, at last click OK. See screenshot:


5. Click OK to close the dialog. And you can see each group’s max/min value is shown.

doc-max-min-in-group-10 doc-max-min-in-group-11

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how to find max value if the value is not entered in ascending order
This comment was minimized by the moderator on the site
Really helpful, exactly what I was looking for
This comment was minimized by the moderator on the site
How to find the minimum date for Compliance =MIN(IF(AND('Cases Created'!C:C="Faults",'Cases Created'!D:D="Compliance"),'Cases Created'!I:I))
This comment was minimized by the moderator on the site
thanks it help to resolve my issue. Great
This comment was minimized by the moderator on the site
The below formula - a variation of the above proposed one - does not seem to work: i added a second criterion to the record selection using the AND function (always returns zero): MIN(IF(AND(A1:A100="01",B2:B100="Male")),C1:C100)). Any way around it?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations