Forum Discussion

DrHoney's avatar
DrHoney
Copper Contributor
Mar 21, 2022
Solved

Mean on excel

Hi there, 
I need your help I need to calculate the mean of SOME numbers of a column can I on excel? 

i' m explaining better, I have in the same column datas that belong to 2 different group I would like to choose all the boxes that belong to one group (the number 1 on an other column) and calculate the mean, and then the others separately. 
Can I do it modifying something in the formula ?

  • DrHoney 

    Let's say that your values are in D2:D100.

    You should have (or create) another column that specifies which group the values belong to. For example in G2:G100 you could have 1 if the cell in column D belongs to one group, and 2 if it belongs to the other group. Of course, you can use other indicators, such as Y and N, or M and F, etc.

    The mean of the first group is returned by

    =AVERAGEIF(G2:G100, 1, D2:D100)

    or

    =AVERAGEIF(G2:G100, "Y", D2:D100)

    etc., and that of the other group by

    =AVERAGEIF(G2:G100, 2, D2:D100)

    etc.

1 Reply

  • DrHoney 

    Let's say that your values are in D2:D100.

    You should have (or create) another column that specifies which group the values belong to. For example in G2:G100 you could have 1 if the cell in column D belongs to one group, and 2 if it belongs to the other group. Of course, you can use other indicators, such as Y and N, or M and F, etc.

    The mean of the first group is returned by

    =AVERAGEIF(G2:G100, 1, D2:D100)

    or

    =AVERAGEIF(G2:G100, "Y", D2:D100)

    etc., and that of the other group by

    =AVERAGEIF(G2:G100, 2, D2:D100)

    etc.

Resources