ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   simple average question (https://www.excelbanter.com/excel-discussion-misc-queries/181212-simple-average-question.html)

CNeils

simple average question
 
I have two columns of data. One column has the gender and the column
alongside has the age of these people. The columns are mixed with males and
female. How do I determine the average age of just the men and just the women?

example:

M 66
F 48
M 20
M 46
F 17

I add to this column week by week so it's not like I can just add everything
up at the end tally the data. Is there a function that I can insert into
another cell that I can label "average age of men" and pull the average age
from the column of information just for the average age of men?

Jim Thomlinson

simple average question
 
Something like this should do...

=SUMIF(A2:A7, "=M", B2:B7)/COUNTIF(A2:A7, "=M")
--
HTH...

Jim Thomlinson


"CNeils" wrote:

I have two columns of data. One column has the gender and the column
alongside has the age of these people. The columns are mixed with males and
female. How do I determine the average age of just the men and just the women?

example:

M 66
F 48
M 20
M 46
F 17

I add to this column week by week so it's not like I can just add everything
up at the end tally the data. Is there a function that I can insert into
another cell that I can label "average age of men" and pull the average age
from the column of information just for the average age of men?


Gary''s Student

simple average question
 
Try the array formula:

=AVERAGE(IF(A1:A1000="M",B1:B1000))

entered with CNTRL-SHFT-ENTER rathr than just the ENTER key.
--
Gary''s Student - gsnu200775


"CNeils" wrote:

I have two columns of data. One column has the gender and the column
alongside has the age of these people. The columns are mixed with males and
female. How do I determine the average age of just the men and just the women?

example:

M 66
F 48
M 20
M 46
F 17

I add to this column week by week so it's not like I can just add everything
up at the end tally the data. Is there a function that I can insert into
another cell that I can label "average age of men" and pull the average age
from the column of information just for the average age of men?



All times are GMT +1. The time now is 02:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com