Count number of cells over 18 but discount dates

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
378
Office Version
  1. 365
Platform
  1. 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:
¦ MrExcel Queries.xlsm
ABCDEFGHIJKLMN
1DoBAgeDoBAgeDoBAgeDoBAgeDoBAgeNumber of adultsShould beNumber under 18Should be
201/01/19844005/04/20204   3111
303/08/19784610/10/20101302/11/20194  4122
429/02/19685613/05/20051906/06/2018617/07/2020414/12/202307233
Count number, discount dates
Cell Formulas
RangeFormula
J2:J4,H2:H4,F2:F4,D2:D4,B2:B4J2=IF(I2="","",((TODAY()-I2)/365))
K2:K4K2=IF(A2="","",COUNTIF(A2:J2,">=18"))
M2:M4M2=IF(A2="","",COUNTIF(A2:J2,"<18"))

Any help would be appreciated :)
 
Last edited:

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
How about
Excel Formula:
=IF(A2="","",COUNTIFS(A2:J2,">=18",$A$1:$J$1,"age"))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,126
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