SUMIF FUNCTION?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top