ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   calculation a average dependated of values in seperate column (https://www.excelbanter.com/excel-worksheet-functions/72007-calculation-average-dependated-values-seperate-column.html)

vinnie123

calculation a average dependated of values in seperate column
 
Hi everyone. I've a spreadsheet with one column (eg. A1:a100)
containing a range of values (ages) and another column (B1:100) a value
of either 1 or 2 (representing males vs females).

How can a find the average of the cells A1:A100 that have a value of 1
in column B; ie. the average age of the males only.

Thanks


Peo Sjoblom

calculation a average dependated of values in seperate column
 
=AVERAGE(IF(B1:B100=1,A1:A100))

entered with ctrl + shift & enter, if there can be blanks in A

=AVERAGE(IF((A1:A100<"")*(B1:B100=1),A1:A100))

--
Regards,

Peo Sjoblom

Northwest Excel Solutions

Portland, Oregon




"vinnie123" wrote in message
oups.com...
Hi everyone. I've a spreadsheet with one column (eg. A1:a100)
containing a range of values (ages) and another column (B1:100) a value
of either 1 or 2 (representing males vs females).

How can a find the average of the cells A1:A100 that have a value of 1
in column B; ie. the average age of the males only.

Thanks




All times are GMT +1. The time now is 09:19 PM.

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