ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting Ages (https://www.excelbanter.com/excel-worksheet-functions/192216-counting-ages.html)

Myjogli

Counting Ages
 
I have a number of rows of data with ages of individuals.

I'd like to count the number of ages, but not all individually.

For example, I'd like to count the total number of 6 - 12 year olds in my
column of ages, etc.

I've been using =COUNTIF(A:A, 1) and then adding them all together, but I
don't want to have to do this for all the numbers from 0 - 86 (my highest
number).

Thanks so much.

Teethless mama

Counting Ages
 
=SUM(COUNTIF(A:A,{"=6","12"})*{1,-1})


"Myjogli" wrote:

I have a number of rows of data with ages of individuals.

I'd like to count the number of ages, but not all individually.

For example, I'd like to count the total number of 6 - 12 year olds in my
column of ages, etc.

I've been using =COUNTIF(A:A, 1) and then adding them all together, but I
don't want to have to do this for all the numbers from 0 - 86 (my highest
number).

Thanks so much.


T. Valko

Counting Ages
 
Assume your ages are in the range A1:A20

Enter you age intervals in a range of cells like this:

......C.....D
1...6.....12
2...13...25
3...26...40

Then enter this formula in E1 and copy down as needed:

=COUNTIF(A$1:A$20,"="&C1)-COUNTIF(A$1:A$20,""&D1)

--
Biff
Microsoft Excel MVP


"Myjogli" wrote in message
...
I have a number of rows of data with ages of individuals.

I'd like to count the number of ages, but not all individually.

For example, I'd like to count the total number of 6 - 12 year olds in my
column of ages, etc.

I've been using =COUNTIF(A:A, 1) and then adding them all together, but I
don't want to have to do this for all the numbers from 0 - 86 (my highest
number).

Thanks so much.





All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com