Forum Discussion
agover17
Jan 25, 2023Copper Contributor
Gathering two maximum and two minimum values of a data set
I have a set of data that has an entry every hour of the day, so 24 entries per day. The data set covers roughly six months. I am trying to find the greatest two values and the lowest two values of e...
OliverScheurich
Jan 25, 2023Gold Contributor
=LET(range,A2:Y182,VSTACK({"date "."Max 1"."Max 2"."Min 1"."Min 2"},HSTACK(TAKE(range,,1),BYROW(range,LAMBDA(row,LARGE(DROP(row,,1),1))),BYROW(range,LAMBDA(row,LARGE(DROP(row,,1),2))),BYROW(range,LAMBDA(row,SMALL(DROP(row,,1),1))),BYROW(range,LAMBDA(row,SMALL(DROP(row,,1),2))))))
An alternative could be this formula which spills the results as shown in the screenshot. If you add dates and numbers you only have to adapt the range to dynamically update the result.
- agover17Jan 27, 2023Copper Contributor
OliverScheurich Thank you so much!