Countifs Question

julesrapley

New Member
Joined
Oct 16, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi all

I have one workbook with 2 worksheets. The first sheet (Database) has 3 columns: Date of Birth, Age, Start Date. The second sheet (Stats) has a start date of 01/04/2023 in cell B2 and End date of 31/03/2025 in cell B3. On the same sheet I have headings: 16 - 19, 20 - 24, 24 - 29, and 50+. I need Excel to total the number of each age range and to automatically update no matter what I change the Start Date/End Date to on the Stats sheet.
 

Attachments

  • Database Screenshot.jpg
    Database Screenshot.jpg
    117.1 KB · Views: 17
  • Stats Screenshot.jpg
    Stats Screenshot.jpg
    43.6 KB · Views: 16

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Unfortunately, my system won't allow me to install anything on my laptop - sorry.
 
Last edited by a moderator:
Upvote 0
Your data doesn't have End Date
 
Upvote 0
There is a start date in cell b1 and end date in cell b2 of the Stats worksheet. These dates will change depending on the report required. Eg if I know to know how many 50+ people were enrolled between 1st and 31st July 2024.
 
Upvote 0
Hello! It proceeded from the fact that on the Database sheet is a smart table with the name Table1, then for the Stats sheet
Book1.xlsm
BC
101.04.2023
231.03.2025
3
4
5
6
7
816-190
920-240
1025-490
1150+0
Stats
Cell Formulas
RangeFormula
C8:C10C8=SUMPRODUCT((Table1[Start date]>=$B$1)*(Table1[Start date]<=$B$2)*(Table1[Age]>=LEFT(B8,FIND("-",B8)-1)+0)*(Table1[Age]<=RIGHT(B8,LEN(B8)-FIND("-",B8))+0))
C11C11=SUMPRODUCT((Table1[Start date]>=$B$1)*(Table1[Start date]<=$B$2)*(Table1[Age]>=LEFT(B11,FIND("+",B11)-1)+0))
 
Upvote 0
Are you open to having the age bands broken out into individual cells (like below) instead of together? The formula would be simpler and more efficient.
Book1
BC
81619
92024
102549
1150
Sheet3
 
Upvote 0
Hi. I don't mind. As long as the result is for the combined number of people within that age range. Would be happy to have a 3rd sheet that had the "workings" if needed, and then the results if that copied onto the Stats sheet.
 
Upvote 0

Forum statistics

Threads
1,225,624
Messages
6,186,068
Members
453,336
Latest member
Excelnoob223

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