MINVISIBLE

MINVISIBLE(rgeValues)
Returns the smallest value from the visible, non blank cells.

rgeValuesThe unit

REMARKS
* This function excludes hidden cells caused by AutoFilter, Grouping or that have been Manually Hidden.
* You can use the built-in MIN function to include hidden cells.
* You can use the user defined MINVISIBLEA function to
* You can use the user defined MINVISIBLEIFS function to
* Similar to the AVERAGEVISIBLE, COUNTVISIBLE, MAXVISIBLE, MEDIANVISIBLE and SUMVISIBLE functions.

 A
1??

Public Function MINVISIBLE( _ 
         ByVal rgeValues As Range) _
         As Double
Dim rgeCell As Range
Dim dbmin As Double
   Application.Volatile
   For Each rgeCell In rgeValues
      If (rgeCell.EntireRow.Hidden = False) And _
         (rgeCell.EntireColumn.Hidden = False) Then
         
         If (Len(rgeCell.Value) > 0) Then
            If (rgeCell.Value <> "True") And _
               (rgeCell.Value <> "False") And _
               (Application.WorksheetFunction.IsText(rgeCell.Value) <> True) Then

               If (dbmin = 0) Then
                  dbmin = rgeCell.Value
               End If
               If (rgeCell.Value < dbmin) Then
                  dbmin = rgeCell.Value
               End If
            End If
         End If
      End If
   Next rgeCell
   MINVISIBLE = dbmin
End Function

Public Function MINVISIBLE2( _
         ByVal rgeValues As Range) _
         As Double
Dim dbmin As Double
   dbmin = Application.WorksheetFunction.Aggregate(5, 5, rgeValues)
   MINVISIBLE2 = dbmin
End Function

© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext