• Statistical calculations with ranges (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Statistical calculations with ranges (2003)

    Author
    Topic
    #452047

    We have a worksheet with data collected every hour of every day for the last 6 years. The data collects a low value and a high value for each hour. We want to show the average for the 8 highest values each day and the average for the 8 lowest values for the day. And, then we need to show the difference between those 2 averages.

    Date Hour Ending Low High
    1/1/2003 100 $22.00 $25.00
    1/1/2003 200 $22.00 $25.00
    1/1/2003 300 $22.00 $25.00

    Any ideas (not using code unless there is no other way)?

    Viewing 0 reply threads
    Author
    Replies
    • #1114766

      Assume you have (for example) the date of interest in F2.
      In G2 you can calculate the average of the 8 smallest values of LOW column by entering the array formula (confirm with ctrl-shift-enter):
      =AVERAGE(SMALL(IF($A$2:$A$2500=F2,$C$2:$C$2500),ROW(INDIRECT(“1:8”))))

      In H2 you can calculate the average of the 8 largest values of HIGH column by entering the array formula (confirm with ctrl-shift-enter):
      =AVERAGE(LARGE(IF($A$2:$A$2500=F2,$D$2:$D$2500),ROW(INDIRECT(“1:8”))))

      In I2 you can calculate the difference:
      =H2-G2

      Adjsut the ranges as needed.

      Steve

      • #1115981

        I’m doing something wrong, Steve. I am getting a zero. I think I’ve adjusted my formula wrong. Can you take a look and tell me what I’m doing wrong?

        Thank you!

        • #1115985

          Steve’s idea was that you would enter the date for which you want the averages in cell F2. Since you already have other data in column F, you should enter the date in another cell and use that in the formula.
          And instead of I2:I50925, you should refer to the column containing the Low values.

        • #1115988

          I have attached a small sample workbook with dummy data and formulas.

          • #1116052

            Thank you! That makes perfect sense now (of course). It worked like a charm!

    Viewing 0 reply threads
    Reply To: Statistical calculations with ranges (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: