Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Countif function question

I have a list of birth dates in column A. I want to provide a list of age
ranges in a summary next to the column. For example I would like to create a
function that would give me the count of birthdates in column A that show the
number of listings that are less than 2 years old. Then I would like to show
the count of listings that are older than 2 years but less than 10 years.
And finally I would like to show the count of listings that are older than 10
years. I would like for the calculation to include the function that would
keep the counts current. This way as I keep this data over the next few
years, I won't have to update the forumula.

I found a few countif threads that touched on portions of this question but
I didn't know how to make it work. I'm using 2007. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Countif function question

"stevestr" wrote:
I found a few countif threads that touched on portions of this
question but I didn't know how to make it work. I'm using 2007.


You could use COUNTIF or, in Excel 2007, COUNTIFS. But I believe that would
require a helper column.

Alternatively:

C1: =sumproduct(--(datedif(A1:A1000,today(),"y")<2))

C3: =sumproduct(--(datedif(A1:A1000,today(),"y")10))

C2: =counta(A1:A1000)-C1-C3

Note: C2 counts the number age 2 or more and age 10 or less, not "older
than 2" and "less than 10". The latter creates a discontinuity: you
neglect to count those that are age 2 and age 10. If that is your intent,
C2 could be written as:

=sumproduct((datedif(A1:A1000,today(),"y")2)*(dat edif(A1:A1000,today(),"y")<10))

Caveat emptor: if the birthday is 2/29/2008 and TODAY() is 2/28/2010,
DATEDIF returns 1, not 2. Is that a problem?


----- original message -----

"stevestr" wrote in message
...
I have a list of birth dates in column A. I want to provide a list of age
ranges in a summary next to the column. For example I would like to
create a
function that would give me the count of birthdates in column A that show
the
number of listings that are less than 2 years old. Then I would like to
show
the count of listings that are older than 2 years but less than 10 years.
And finally I would like to show the count of listings that are older than
10
years. I would like for the calculation to include the function that
would
keep the counts current. This way as I keep this data over the next few
years, I won't have to update the forumula.

I found a few countif threads that touched on portions of this question
but
I didn't know how to make it work. I'm using 2007. Thanks


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Countif function question

stevestr wrote:
I have a list of birth dates in column A. I want to provide a list of age
ranges in a summary next to the column. For example I would like to create a
function that would give me the count of birthdates in column A that show the
number of listings that are less than 2 years old. Then I would like to show
the count of listings that are older than 2 years but less than 10 years.
And finally I would like to show the count of listings that are older than 10
years. I would like for the calculation to include the function that would
keep the counts current. This way as I keep this data over the next few
years, I won't have to update the forumula.

I found a few countif threads that touched on portions of this question but
I didn't know how to make it work. I'm using 2007. Thanks


For a start, see Chip Pearson's exposé on the practically abandoned
DATEDIF function: http://www.cpearson.com/excel/datedif.aspx

You are not clear what to do with "number of listings that are /equal to
2 years old/" (similarly for /equal to 10 years old/), but these are
merely boundary conditions to be worked out.

Post back if you get stuck.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on the countif function and times MTSkibum Excel Worksheet Functions 3 July 16th 08 11:34 PM
countif function question dveenhuis Excel Worksheet Functions 3 September 13th 07 01:46 PM
A question about the Count/CountIf function Carl Excel Worksheet Functions 3 January 12th 07 09:10 AM
CountIf Function Question Josh in Indy Excel Discussion (Misc queries) 4 April 6th 06 08:28 PM
Countif/Sumif function question psyd Excel Worksheet Functions 0 November 5th 04 06:09 AM


All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"