Juggler_IN
Active Member
- Joined
- Nov 19, 2014
- Messages
- 358
- Office Version
- 2003 or older
- Platform
- Windows
I have two functions from one of the threads in MrExcel forum.
How do i use this in a formula? say, =Maxi(A1:A9)
Code:
Function Mini(ParamArray values() As Variant) As Variant
Dim minValue, Value As Variant
minValue = values(0)
For Each Value In values
If Value < minValue Then minValue = Value
Next
Mini = minValue
End Function
Function Maxi(ParamArray values() As Variant) As Variant
Dim maxValue, Value As Variant
maxValue = values(0)
For Each Value In values
If Value > maxValue Then maxValue = Value
Next
Maxi = maxValue
End Function
HTML:
https://www.mrexcel.com/forum/excel-questions/132404-max-min-vba.html
How do i use this in a formula? say, =Maxi(A1:A9)