Average with grouping

Anonymous
2023-03-15T04:35:38.3533333+00:00

Please help me achieve the average!

Name Month Sal Average
ABC JAN 2
ABC FEB 4
ABC MAR 6 4
XYZ JAN 5
XYZ FEB 10
XYZ MAR 15 10
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author
Emi Zhang-MSFT 30,206 Reputation points Microsoft External Staff
2023-03-15T07:30:35.67+00:00

Hi @Kunder, Santhosha SBOBNG-PTIV/ES,

Try this formula:

=IF(COUNTIF($A$2:A2,A2)=COUNTIF($A$2:$A$7,A2),AVERAGEIF($A$2:$A$7,A2,$C$2:$C$7),"")

User's image

Hope it's helpful.


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Oldest
  1. Ashish Mathur 102.6K Reputation points Volunteer Moderator
    2025-07-27T23:31:58.61+00:00

    Hi,

    If the number of cells to be averaged is always 3 and the first column is sorted in ascending order and months are always arranged in order, then enter this formula in cell D2

    =IF(A2=A3,"",AVERAGE(OFFSET(C2,-2,0,3,1)))

    Hope this helps.

    User's image

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.