3 Replies Latest reply: May 15, 2018 6:03 AM by Haidar Haj Ali RSS

    Average of last 5 better results from the 6 last results

    Haidar Haj Ali

      Hello,

       

      Here is my problem, I have a table as follow:

      ID RESULTS
      15
      28
      37
      45
      58
      69
      75
      84
      910
      102

       

      I need to calculate the average of the last 5 better results from 6 last results. In my case a the smaller the result is the better.

      So in the example above, the 6 last results are results with ID 5 to 10. The best 5 are IDs: 10, 8, 7, 6 and 5.

      The average will be (2+4+5+9+8)/5 = 5.6.

       

      ID is always incremental.

      Thanks for your help.

       

      Regards.