Forum Discussion
JPScottIII
Nov 13, 2021Copper Contributor
MIN function exclude "Zero" values - Non Consecutive group of cells
I am struggling with ignore zero values when the group of cells to be tested is not a consecutive range The function "=MIN(D7,M7,V7,AE7,AN7)" works fine but I want to ignore lowest value if AE7 a...
Martin_Angosto
Jul 11, 2024Iron Contributor
That is the "trick":
The first positive number is counted to be the first (independently if it is not unique).
That is, 1 is the first positive number. It is repeated, but it would be still counted as the first positive number.
However, for the sake of finding the second smallest number, this one should not be repeated. The uniqueness requirement is only affected by the second smallest positive number, the one we are looking to retrieve. Not for the first smallest positive value.
SergeiBaklan
Jul 11, 2024Diamond Contributor
So, If I understood correctly
=LET(a, {-1,1,1,8,9}, f, FILTER(a,a>0), SMALL(HSTACK(TAKE(f,,1),UNIQUE(f,1,1)),2) )
=LET(a, {-1,1,1,8,8,9}, f, FILTER(a,a>0), SMALL(HSTACK(TAKE(f,,1),UNIQUE(f,1,1)),2) )