+ Reply to Thread
Results 1 to 8 of 8

Count values larger than zero between two dates

  1. #1
    Registered User
    Join Date
    05-20-2021
    Location
    Finland
    MS-Off Ver
    Office18
    Posts
    18

    Count values larger than zero between two dates

    Hi,

    I have a problem. I need to count how many values are larger than zero between two given dates in each column. Attached is my sample file. Could this be doable with functions like sumproduct or countif? Thank you!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,762

    Re: Count values larger than zero between two dates

    Administrative Note:

    Members will tailor the solutions they offer to the version (NOT release number) of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Count values larger than zero between two dates

    Use I1 for the start date and J1 for the end date, then you can use this formula:

    =SUMPRODUCT((C1:G2500>0)*(A1:A2500>=$I$1)*(A1:A2500<$J$1))

    Hope this helps.

    Pete

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,762

    Re: Count values larger than zero between two dates

    Which column are you wanting to look at? Or do you mean ALL columns?

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

  5. #5
    Registered User
    Join Date
    05-20-2021
    Location
    Finland
    MS-Off Ver
    Office18
    Posts
    18

    Re: Count values larger than zero between two dates

    Thanks for replies! I am trying to look at each column individually. So far I have not gotten the formula to work which pete offered.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Count values larger than zero between two dates

    See attached file, with the original formula in cell I3.

    I've also put this formula in I6 (with column letters across row 5):

    =SUMPRODUCT((C$1:C$2500>0)*($A$1:$A$2500>=$I$1)*($A$1:$A$2500<$J$1))

    and copied it across, to give you the counts for each column.

    Hope this helps.

    Pete
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-20-2021
    Location
    Finland
    MS-Off Ver
    Office18
    Posts
    18

    Re: Count values larger than zero between two dates

    Yes thank you! I had a typo originally so that was why it did not work.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Count values larger than zero between two dates

    Glad to help.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Formula to extract a sub-set of dates from a larger set
    By AllyGator in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2020, 03:54 AM
  2. Count number of dates values in each cell and retain larger value only
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2016, 11:07 PM
  3. Formula to count if one value is larger then the other
    By tjdarla in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-15-2014, 11:26 AM
  4. Replies: 10
    Last Post: 10-09-2014, 08:06 PM
  5. Row Count is 15 times larger than actual rows
    By DanaHoff in forum Excel General
    Replies: 5
    Last Post: 04-12-2014, 11:14 PM
  6. [SOLVED] Dates are broken for use in a larger macro
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2012, 06:27 PM
  7. Displaying larger values with smaller values in a Column Chart
    By Max9 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-20-2010, 11:59 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