ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUMIF FUNCTION? (https://www.excelbanter.com/excel-worksheet-functions/44068-sumif-function.html)

Betsey

SUMIF FUNCTION?
 
I need to sum two cells based on an age table.

If A2 is between two values (ie 15 & 29 then add cell C2 & G2; 45 & 49
then add C7 & G2)

There are 12 age bands.

My brain has stopped working and I know there has to be an easy way to do
this, but I'm not seeing it right now.

Thanks

Duke Carey

Your question doesn't provide many details, so...

Assuming you have the lower numbers for each band in A2:A13, the higher
numbers in B2:B13, and the values to be added to G2 in the C2:C13 range, then

=SUMPRODUCT(--(A2:A13<=age),--(B2:B13=age),C2:C13)+G2

replace age with the address of the cell containing the age you are testing

If you truly want to test for an age being BETWEEN the upper & lower limits,
delete the equal signs

"Betsey" wrote:

I need to sum two cells based on an age table.

If A2 is between two values (ie 15 & 29 then add cell C2 & G2; 45 & 49
then add C7 & G2)

There are 12 age bands.

My brain has stopped working and I know there has to be an easy way to do
this, but I'm not seeing it right now.

Thanks



All times are GMT +1. The time now is 04:18 AM.

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