+ Reply to Thread
Results 1 to 6 of 6

Counting dates in range

Hybrid View

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    40

    Counting dates in range

    G'day excel gurus,
    I need to collect stats for the number of referrals each month to our service. As you can see on the attached workbook, I want to collect stats for each month starting in July 2015. On sheet 1 I have referral dates in (dd/mm/yyyy) format. On sheet2, I want to represent the number of referrals in July, august etc.

    I'd appreciate the help.

    Thanks


    Book3.xlsx

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Counting dates in range

    Try this formula in A3 (copied across to C3)

    Formula: copy to clipboard
    =COUNTIFS(Sheet1!$A:$A,"<=" & EOMONTH(A$2,0),Sheet1!$A:$A,">=" & EOMONTH(A$2,-1)+1)

  3. #3
    Registered User
    Join Date
    07-21-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Counting dates in range

    Thanks quekbc, your solution worked well on the example that I gave but not at all on my real life workbook. Not sure why but I obviously need to learn more about the EOMONTH function.

    alansidman, your solution of adding the =month column is the best solution for me. I'll use this one.

    Marked as solved!

    thanks!
    Last edited by cjharwood; 09-01-2015 at 10:13 PM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,712

    Re: Counting dates in range

    On sheet 1 in column B type =month(A2) and copy down
    In cell A3 on sheet 2 type =countif(sheet1!A2:A26,7)

    Repeat on Sheet 2 changing the month value.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Counting dates in range

    cjharwood, chances are the dates on your real life workbook is currently stored as text rather than actual dates.

    Additionally, just as a precaution, know that alansidman's solution is not year dependent. That is, Jun-2015 and Jun-2016 will be counted together.

  6. #6
    Registered User
    Join Date
    07-21-2015
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Counting dates in range

    quekbc, my dates cells are all formatted as dates not text, I suspect I've made an error with the formula somewhere.

    You have a good point about the alansidman solution not differentiating between years.... I fiddle with it for a while and see if this becomes an issue.

+ 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. [SOLVED] counting dates in a range
    By bzl in forum Excel General
    Replies: 2
    Last Post: 12-11-2014, 11:41 AM
  2. Counting dates within a range
    By mhitomi_7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2013, 08:05 PM
  3. Counting dates between a range
    By mungel in forum Excel General
    Replies: 2
    Last Post: 05-23-2010, 10:48 PM
  4. Counting a value based on a range of dates
    By Sean Donohoe in forum Excel General
    Replies: 2
    Last Post: 11-18-2009, 12:44 PM
  5. Counting dates in a range
    By stevewilde in forum Excel General
    Replies: 4
    Last Post: 07-07-2009, 07:30 AM
  6. [SOLVED] Counting dates in a RANGE (yargh!) :)
    By S Davis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-26-2006, 10:10 PM
  7. [SOLVED] Counting Dates in a Range
    By Matt7102 in forum Excel General
    Replies: 9
    Last Post: 01-13-2006, 07:20 PM

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