+ Reply to Thread
Results 1 to 4 of 4

Formula to Count Events Between Specific Dates and Having Adjacent Values >0

  1. #1
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Eagle River, Alaska
    MS-Off Ver
    Excel 2010
    Posts
    145

    Formula to Count Events Between Specific Dates and Having Adjacent Values >0

    I have a yearly running log (attached). At the bottom in cell [B88] I would like to develop a formula that gives me the number of times I ran in that specific month. Dates are in Column A and running distances are in Column B. If a distance is zero, I don't want to count it. I have attempted to solve this using the =COUNTIFS formula, but I am not able to structure it properly. Maybe =COUNTIFS is not what I should be using. Thanks for your help!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-26-2013
    Location
    Norway
    MS-Off Ver
    Excel 2013
    Posts
    67

    Re: Formula to Count Events Between Specific Dates and Having Adjacent Values >0

    Hi

    I am sure there are many ways of doing this, but this is my approach:
    B88 = SUMPRODUCT((MONTH($A$2:$A$83)=ROW(A1))*($B$2:$B$83>0))
    Best regards

    Per Erik Midtr?d

  3. #3
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Eagle River, Alaska
    MS-Off Ver
    Excel 2010
    Posts
    145

    Smile Re: Formula to Count Events Between Specific Dates and Having Adjacent Values >0

    Perfect!! Many thanks!!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to Count Events Between Specific Dates and Having Adjacent Values >0

    Here's how to do it using COUNTIFS.

    Enter the 1st of the month dates in A88:A99...

    1/1/2013
    2/1/2013
    3/1/2013
    etc
    etc
    12/1/2013

    You can format them to display just the short month name by formatting the cells as Custom mmm.

    Then, enter this formula in B88 and copy down to B99:

    =COUNTIFS(A$2:A$83,">="&A88,A$2:A$83,"<="&EOMONTH(A88,0),B$2:B$83,">0")

    However, I think it's easier to just leave the month names as is (text entries) and use this formula:

    =SUMPRODUCT(--(TEXT(A$2:A$83,"mmm")=A88),--(B$2:B$83>0))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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 COUNT UNIQUE Values BETWEEN given dates
    By wantutri in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-09-2013, 12:09 PM
  2. Replies: 2
    Last Post: 02-27-2013, 11:16 PM
  3. [SOLVED] A formula to count adjacent cell values?
    By Nate Westcott in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2012, 10:15 PM
  4. Having a formula count only specific dates.
    By szm187 in forum Excel General
    Replies: 3
    Last Post: 03-15-2012, 11:28 AM
  5. Count values in a range that appear for specific dates
    By galvinpaddy in forum Excel General
    Replies: 1
    Last Post: 11-02-2011, 03:45 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