Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to get max/min of visible cells only in Excel?

Author Kelly Last modified

We can apply the Max function and Min function to easily get the max/min in a range in Excel. But do you know how to get the max/min value while ignoring hidden cells? What if you want to apply conditional formatting to visible cells only to highlight the max/min values? The following solutions will ease your work:


Get max/min of visible cells only with SUBTOTAL function

We can apply the SUBTOTAL function to get the maximum value or minimum value of visible cells only in Excel.

Select a blank cell you will place the maximum value of visible cells only into, type the formula =SUBTOTAL(104,C2:C19) into it, and press the Enter key. Then you will get the maximum value of visible cells only. See screenshot:
A screenshot showing the SUBTOTAL function for max value in visible cells only

Notes:
(1) In above formula, C2:C19 is the list where you will get the maximum value of visible cells only.
(2) To get the minimum value of visible cells only, please apply this formula =SUBTOTAL(105,C2:C19).

Sum/Count/Average visible cells only in a specified range with ignoring hidden or filtered cells/rows/columns

The normally SUM/Count/Average function will count all cells in the specified range on matter cells are hidden/filtered or not. While the Subtotal function can only sum/count/average with ignoring hidden rows. However, Kutools for Excel's SUMVISIBLE/ COUNTVISIBLE/ AVERAGEVISIBLE functions will easily calculate the specified range with ignoring any hidden cells, rows, or columns.

Advertisement for Kutools showing the Sum/Count/Average visible cells feature

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now

Get max/min of visible cells only with conditional formatting

This method will introduce the Conditional Formatting feature to get the maximum/minimum value of visible cells only easily in the filtered list.

1. Select the range you will get the max/min of visible cells only without the headers, and click Home > Conditional Formatting > New Rule. See screenshot:
A screenshot showing Conditional Formatting menu option in Excel

2. In the opening New Formatting Rule dialog box, please:
(1) Click to highlight the Use a formula to determine which cells to format option in the Select a Rule Type box;
(2) Type the formula =$C2=AGGREGATE(4,7,$C$2:$C$22) (C2:C22 is the filtered column where you will get the maximum value of visible cells only, and C2 is the first cell of this filtered column ) into the Format values where this formula is true box;
Note: For getting the minimum value of visible cells only, please apply this formula =$C2=AGGREGATE(5,7,$C$2:$C$22).
(3) Click the Format button.

3. In the opening Format Cells dialog box, please specify a format as you need, and click the OK button.

In our case, we select a highlight color under the Fill tab. See screenshot:
A screenshot of Format Cells dialog in Excel, setting format for Conditional Formatting

4. Now it returns to the New Formatting Rule dialog box. Please click the OK button to apply this conditional formatting.

So far, when we filter the specified range, it will automatically highlight the row with maximum value (or minimum value). See screenshots:
A screenshot of highlighted max value cell in filtered range using Conditional Formatting

Note: This method works in Excel 2010 and later versions.


Get max/min of visible cells only in each row/column with Kutools for Excel

This method will introduce Kutools for Excel’s Select Cells with Max & Min Value utility to quickly find out the maxi/min value of visible cells only in each row/column easily.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Select the range with filtered/hidden rows or columns, next press the Alt +; keys simultaneously to select the visible rows and columns only, thirdly press the Ctrl + C keys to copy the visible cells and columns only, and at last select the destination range and press the Ctrl + V keys to paste the visible rows and columns. See screenshot:

A screenshot of selecting and copying only visible cells in Excel

2. Keep selecting the new range, and click Kutools > Select > Select Cells with Max & Min Value. See screenshot:
Kutools for Excel’s Select Cells with Max & Min Value utility window

3. In the opening Select Cells With Max & Min Value dialog box, please:
(1) In the Go To section, please check the Minimum value option or Maximum value option as you need. In our case, we check the Maximum value option;
(2) In the Base section, please specify the scale you will get the max/min value. In our case, we check the Entire row option;
(3) In the Select section, please check the First cell only option or All cells option as you need. In our case, we check the All cells option.
(4) Click the Ok button.

4. Another Select Cells With Max & Min Value dialog box comes out and shows how many cells have been found and selected. Just click the OK button to close it. And then you will see the maximum value in each row has been found and selected. See screenshots:

A screenshot of success dialog
Final result with maximum values highlighted in each row using Kutools

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now


Demo: Get max/min value in visible range/rows/columns

Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Related articles:

Sum only filtered or visible cells in Excel

Count ignore hidden cells/rows/columns in Excel

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
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in