Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The function below excludes cells with the value of #N/A. I am also trying
to get it to exclude cells with a value of 0 (zero). Thus if I have 4 cells with the follwing values: #N/A 10 0 40 The min value that would be calculated would be 10. thanks, bob k Function MinPrice4(ParamArray arglist() As Variant) As Variant 'text or number Dim arg As Variant Dim FoundANumber As Boolean Dim myMin As Double myMin = 100 ^ 100 'some really big number FoundANumber = False For Each arg In arglist If IsNumeric(arg) Then FoundANumber = True myMin = WorksheetFunction.Min(myMin, arg) End If Next arg If FoundANumber = True Then MinPrice4 = myMin Else MinPrice4 = "Item Not Bid" End If End Function Sub aa() MsgBox MinPrice4("a", 3, CVErr(xlErrNA)) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a Custom Excel Function to Calculate Gini Coefficients | Excel Worksheet Functions | |||
VBA | Excel Worksheet Functions | |||
Date & Time | New Users to Excel | |||
Automatically up date time in a cell | Excel Discussion (Misc queries) | |||
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. | Excel Worksheet Functions |