Counting age group between dates

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
320
Office Version
  1. 2007
Hello I'm trying to count age groups between dates such as 01/01/2014 to 31/12/1014.

I have the following working for age 16 and under however I have other age groups such as "age 17 to 25" "26 to 30" "13 to 40"not sure how to do this is there anyone who can suggest how I can do this?

=SUMPRODUCT(IF((Data!A2:A20>=A1)*(Data!A2:A20<=A2),1*(COUNTIF(Data!B2:B20,"<=16"))))

I have a data sheet and an analysis sheet

Thank you in advance, any help is much appreciated
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I don't think your formula works for ages <=16.
It should be
=SUMPRODUCT(--(Data!A2:A20>=A1),--(Data!A2:A20<=A2),--(Data!B2:B20<=16))

For ages 17 to 25 try
=SUMPRODUCT(--(Data!A2:A20>=A1),--(Data!A2:A20<=A2),--(Data!B2:B20>=17), --(Data!B2:B20<=25))

M.
 
Upvote 0
I don't think your formula works for ages <=16.
It should be
=SUMPRODUCT(--(Data!A2:A20>=A1),--(Data!A2:A20<=A2),--(Data!B2:B20<=16))

For ages 17 to 25 try
=SUMPRODUCT(--(Data!A2:A20>=A1),--(Data!A2:A20<=A2),--(Data!B2:B20>=17), --(Data!B2:B20<=25))

M.
Thank you so much this works a treat!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top