SaraWitch
Active Member
- Joined
- Sep 29, 2015
- Messages
- 377
- Office Version
- 365
- Platform
- Windows
Hello peeps,
I want to count the number of cells in a range over and under 18 but want to discount dates. I feel like I should know this (maybe something around formatting?), but not getting anywhere. The formula will likely always work for under 18 but it's the 18 and over (C.K) I'm struggling with:
Any help would be appreciated
I want to count the number of cells in a range over and under 18 but want to discount dates. I feel like I should know this (maybe something around formatting?), but not getting anywhere. The formula will likely always work for under 18 but it's the 18 and over (C.K) I'm struggling with:
¦ MrExcel Queries.xlsm | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | |||
1 | DoB | Age | DoB | Age | DoB | Age | DoB | Age | DoB | Age | Number of adults | Should be | Number under 18 | Should be | ||
2 | 01/01/1984 | 40 | 05/04/2020 | 4 | 3 | 1 | 1 | 1 | ||||||||
3 | 03/08/1978 | 46 | 10/10/2010 | 13 | 02/11/2019 | 4 | 4 | 1 | 2 | 2 | ||||||
4 | 29/02/1968 | 56 | 13/05/2005 | 19 | 06/06/2018 | 6 | 17/07/2020 | 4 | 14/12/2023 | 0 | 7 | 2 | 3 | 3 | ||
Count number, discount dates |
Cell Formulas | ||
---|---|---|
Range | Formula | |
J2:J4,H2:H4,F2:F4,D2:D4,B2:B4 | J2 | =IF(I2="","",((TODAY()-I2)/365)) |
K2:K4 | K2 | =IF(A2="","",COUNTIF(A2:J2,">=18")) |
M2:M4 | M2 | =IF(A2="","",COUNTIF(A2:J2,"<18")) |
Any help would be appreciated
Last edited: