ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum If or DSUM help? (https://www.excelbanter.com/excel-worksheet-functions/40603-sum-if-dsum-help.html)

towl

Sum If or DSUM help?
 

Hi, I have a table full of data, and I want to do a sum on the data, if
two conditions are met, for example:

3 Columns A , B, C contain:
In A Sex
In B Age
In C Salary

Down the rows it is Male or Female persons age and Salary.


I then have another table with criteria in it, again 3 columns ABC
A Sex
B Age
C hopeful formula result

In c I am after the sum of all the salaries of the two conditions in
A&B, so if A is male and B is 24, I want the formula to sum up all the
salaries of Male 24 year olds in the origional table.

I know this could be done in lotus, but can it be done in Excel?

Any help appreciated.


--
towl
------------------------------------------------------------------------
towl's Profile: http://www.excelforum.com/member.php...o&userid=26340
View this thread: http://www.excelforum.com/showthread...hreadid=396082


Bob Phillips

=sumproduct(--(A2:A200=sex),--(B2:B200=age),C2:C200)

--
HTH

Bob Phillips

"towl" wrote in message
...

Hi, I have a table full of data, and I want to do a sum on the data, if
two conditions are met, for example:

3 Columns A , B, C contain:
In A Sex
In B Age
In C Salary

Down the rows it is Male or Female persons age and Salary.


I then have another table with criteria in it, again 3 columns ABC
A Sex
B Age
C hopeful formula result

In c I am after the sum of all the salaries of the two conditions in
A&B, so if A is male and B is 24, I want the formula to sum up all the
salaries of Male 24 year olds in the origional table.

I know this could be done in lotus, but can it be done in Excel?

Any help appreciated.


--
towl
------------------------------------------------------------------------
towl's Profile:

http://www.excelforum.com/member.php...o&userid=26340
View this thread: http://www.excelforum.com/showthread...hreadid=396082




Devlin

You can make another column (let's say D) near the original table where
you will put the concatenated values of SEX and AGE cells: =A2&B2 ---
so you'll have something like Male24. Then, in the second table you'll
use sumif - for instance, supposing that he columns of your second
table are M=SEX, N=AGE, O=formula you want, then the formula will be
=sumif(D2:D100,M2&N2,C2:C100). Excel will search column D for all the
Male24 and will sum the corresponding values from column C.

Best luck,
Devlin



All times are GMT +1. The time now is 11:16 PM.

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