Is there a way to return a min. number great than zero from a row?
For instance
A, B,C, D, E, F, G
0,-1,2, 4, 7, -2 2
I want to see "2" on the column G.
Thanks
Is there a way to return a min. number great than zero from a row?
For instance
A, B,C, D, E, F, G
0,-1,2, 4, 7, -2 2
I want to see "2" on the column G.
Thanks
you can use this function, in g1 cell copy =min_g_zero(a1:f1) and drag the cell down
you have the paste this function by creating a module in visual basic editor,
go to->tools->macro->visual basic editor , select "microsoft excel objects" , right click-> insert module and then in the editor space paste the below code.
Function min_g_zero(d As Range)
Dim k As Integer
Dim val As Variant
k = 0
val = "-1"
For Each c In d
If c > 0 Then
If k = 0 Then
val = c
Else
If c < val Then
val = c
End If
End If
k = k + 1
End If
Next
If val = -1 Then
min_g_zero = "no cells are greater than zero "
Else
min_g_zero = val
End If
End Function
Or if you want a formula:
=MIN(IF(A1:G1>0;A1:G1;""))
Ola Sandstrom
Hold down Ctrl and Shift then hit Enter to confirm the formula.
It is giving me error when I use that function. I was trying to correct it, but not able to correct it.
It should work if it's Entered as an Array formula - Hold down Ctrl and Shift then hit Enter to confirm the formula. Othervise you will get #VALUE!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks