6.4 Search for position of a certain value, take the value by position

 

We have a statistical table for daily sales of January 2022:

imagepng

Now we want to find out the day with the largest sales. Enter the following in cell C2:

=spl("=E(?1).pmax(Sales)",A1:B32)

The returned result is 12.
Next, find out the sales of 5 days before and after the day with the largest sales:

=spl("=E(?1).to(?2-5,?2+5)",A1:B32,C2)

imagepng