XOR LX,

Sorry you don't understand, I try my best to keep it simple but its not easy for me.
We really tried to be precise with the "Requirement", see below and on workbook and with the best so far ideas = a macro to replace ROW(A1)in the function with contents of cell F.
We don't mind a completely different function but of course we adhere to the forum rules the best we can in how we go about it.

Requirement: the start and end values in column I index of the three variable values in G1 G2 & G3 by position via column H, large & small
G1 = Maximum
G2 = Minimum other than 0
G3 = independent value between G1 & G2 that is not 0
Column H length can vary H1:H60000, generally ascending or 0 (from an IF origin)
The total count of values other than 0 see in F4 can also vary

Thanks again for your comments

Kind Regards

Paul