Excel Average every 3 rows calculation

Anonymous
2022-03-29T08:28:15+00:00

I have a set of data in a column A in excel sheet.

I need to calculate average in column B for every 3 data placed in Column A.

Initially I have calculated for the average of A1, A2 and A3 and get the average value in Column B1.
Then I am dragging the B1 cell to calculate the average of A4, A5 and A6 in B2 Cell.

But the probelem is, in B2 cell, the average is calculated for A2, A3 and A4 instead of A4, A5 and A6. I have a lengthy of data to calculate the average. So every time, due to the above issue, I am fixing the column manually for average calculation. How to solve this issue. Advance thanks for your help.

Microsoft 365 and Office | Excel | For education | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2022-03-29T10:01:12+00:00

    Hi [Siva]

    Try any of the following formulas in cell B2 and drag/copy it down

    =IFERROR(AVERAGE(OFFSET($A$1,3*(ROW(A1)-1)+1,0,3,1)),"")

    Or better

    =IFERROR(AVERAGE(OFFSET($A$1,3*ROW(A1)-2,0,3,1)),"")

    Image

    I hope this helps you and gives a solution to your problem

    Do let me know if you need more help

    Regards

    Jeovany

    4 people found this answer helpful.
    0 comments No comments

12 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-03-30T01:47:35+00:00
    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2022-03-29T11:08:15+00:00

    Hi,

    If you use Excel 365 then try this formula:

    =LET(
    
        rng,$A$1:$A$100,
    
        rnga,A1:$A$100,
    
        data,rng/(INT(SEQUENCE(COUNT(rng),,0)/3)+1=COUNT(rng)-(COUNT(rnga)-1)),
    
    IFERROR(AVERAGE(FILTER(data,NOT(ISERROR(data)))),"")
    
    )
    

    This formula avoid using OFFSET function, which is a volatile function.

    HTH

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2022-03-29T12:02:58+00:00

    Formula (w/o using OFFSET) in cell B2 to be copied down:

    =AVERAGE(INDEX(A$2:A$20,(ROW(A1)-1)*3+1):INDEX(A$2:A$20,(ROW(A2)-1)*3))

    Regards,

    Amit Tandon

    http://www.excelanytime.com/

    4 people found this answer helpful.
    0 comments No comments
  4. Lz._ 38,106 Reputation points Volunteer Moderator
    2022-03-29T12:45:58+00:00

    Hi

    With the LAMBDA & Co. functions, a dynamic array in B1:

    Image

    in B1:

    =LET( 
    
        rng, FILTER(A1:A100,A1:A100<>""), 
    
        rws, ROWS(rng), 
    
        MAKEARRAY(ROUNDUP(rws/3,0),1, 
    
            LAMBDA(r,c, 
    
                LET( 
    
                    s, (r*3)-2, 
    
                    AVERAGE( INDEX(rng,SEQUENCE(MIN(rws-s+1,3),,s)) ) 
    
                ) 
    
            ) 
    
        ) 
    

    )

    OR

    =LET( 
    
        rng, FILTER(A1:A100,A1:A100<>""), 
    
        rws, ROWS(rng), 
    
        seq, (SEQUENCE(ROUNDUP(rws/3,0))*3)-2, 
    
        MAP(seq,rws-seq+1, 
    
            LAMBDA(x,s, 
    
                AVERAGE( INDEX(rng,SEQUENCE(MIN(s,3),,x)) ) 
    
            ) 
    
        ) 
    
    )
    
    0 comments No comments