+ Reply to Thread
Results 1 to 6 of 6

Count If between age dates to the a correct chart

  1. #1
    Forum Contributor
    Join Date
    04-13-2017
    Location
    Buchares
    MS-Off Ver
    2016
    Posts
    117

    Count If between age dates to the a correct chart

    Hey guys
    I have a column with birth dates and i want to get the correct statistics for the age reviews

    The table I want to create
    How many
    Between 16 -23 1
    Between 23 - 35 21
    Between 35 - 45 2
    Between 45 - 57 4
    Between 57 - 65 5
    Between more than 65 6

    I want to eliminate the red column from the worksheet where the years are calculated
    Attached Files Attached Files
    Last edited by alexgoaga; 01-08-2019 at 09:10 AM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Count If between age dates to the a correct chart

    Self deleted
    Last edited by azumi; 01-08-2019 at 09:43 AM.

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Count If between age dates to the a correct chart

    =SUMPRODUCT(--(DATEDIF($A$2:$A$33,TODAY(),"y")>G10))-SUM($J$11:J11)
    Why do you use UDF?
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-13-2017
    Location
    Buchares
    MS-Off Ver
    2016
    Posts
    117

    Re: Count If between age dates to the a correct chart

    Quote Originally Posted by tim201110 View Post
    =SUMPRODUCT(--(DATEDIF($A$2:$A$33,TODAY(),"y")>G10))-SUM($J$11:J11)
    Why do you use UDF?
    The UDF was and is used on the bigger project to get the years and months and days

    This code should be working using the sum product, looks brilliant . Thank you for your time

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Count If between age dates to the a correct chart

    B2 this gives year with decimal, Eg; 35 Years 6 months is 35.5 year this will fall to 35-45

    =YEARFRAC(A2,TODAY(),3)

    C2 this gives only full year, Eg; 35 Years 6 months is 35 year this will fall to 23-35
    =DATEDIF(A2,TODAY(),"y")

    Count use Frequency with a high limit.

    =INDEX(FREQUENCY(B$2:B$33,$G$5:$G$9),ROWS(J$5:J5))
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Count If between age dates to the a correct chart

    New table created. Pl See file.
    In G4 then copy down.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 08-28-2018, 02:56 PM
  2. Replies: 8
    Last Post: 07-20-2018, 11:52 AM
  3. Waterfall chart need to auto count dates
    By Snickers1 in forum Excel General
    Replies: 0
    Last Post: 11-25-2016, 07:37 PM
  4. Column chart, one data column of dates: count of month & year
    By brucemc777 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-11-2016, 12:49 PM
  5. Trying to chart dates values by count
    By jam320 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-31-2015, 10:20 AM
  6. Replies: 10
    Last Post: 09-04-2013, 08:34 PM
  7. [SOLVED] Range Address Is Correct Columns Count Is Not Correct
    By goss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2013, 12:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1