+ Reply to Thread
Results 1 to 8 of 8

Using Sumproduct to Count Dates Ignoring Blanks

  1. #1
    Registered User
    Join Date
    04-11-2024
    Location
    South Carolina, USA
    MS-Off Ver
    MS 365
    Posts
    2

    Using Sumproduct to Count Dates Ignoring Blanks

    Alright it's a little convoluted but stick with me.

    I'm working on a motorsports spreadsheet and am trying to count the number of times a race has been held on a date (not including year, so for example how many times there was a race on May 5th).

    The formula I have currently is =SUMPRODUCT(--(MONTH($E:$E<>0)=5),--(DAY($E:$E<>0)=1)) and returns 0, which I know to be untrue thanks to a PivotTable I've made that groups the dates in month-day form for me. Adding the range as the first and fourth arrays (=SUMPRODUCT($E:$E,--(MONTH($E:$E<>0)=5),$E:$E,--(DAY($E:$E<>0)=1))) also returns 0, and changing <>0 to <>"" does nothing to the value.

    (The reason I'm doing this to begin with is to have the data organized in a calendar-style format)

    I'd like to keep the range the entire column of E, so I don't have to continuously update the formula 366 times per race, and I can just input the date of the next race and the calendar update itself. Of course this means I'd like the formula to disclude blanks.

    What in the formula is causing the error, and how do I fix it?

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

    Re: Using Sumproduct to Count Dates Ignoring Blanks

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,700

    Re: Using Sumproduct to Count Dates Ignoring Blanks

    Try, for example,
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Don't use full column references with SUMPRODUCT. It will adversely affect performance of the workbook.

    With 365, you could use something like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


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

    Re: Using Sumproduct to Count Dates Ignoring Blanks

    I'm not sure that the 'dates' are really dates - still need to see a workbook, if TMS' solution does not work.

  5. #5
    Registered User
    Join Date
    04-11-2024
    Location
    South Carolina, USA
    MS-Off Ver
    MS 365
    Posts
    2

    Re: Using Sumproduct to Count Dates Ignoring Blanks

    Sample.xlsx

    Here's some data used in the sheet with the expected look of the calendar done manually.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,677

    Re: Using Sumproduct to Count Dates Ignoring Blanks

    Not the same setup but the same values.
    The formula used is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,863

    Re: Using Sumproduct to Count Dates Ignoring Blanks

    You could try in D3:

    =LET(rng,$A$1:$A$1000,a,FILTER(rng,(MONTH(rng)=MONTH(D2))*(DAY(rng)=DAY(D2)),0),IF(@a=0,0,ROWS(a)))

    copied across and then down to each row where needed.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Using Sumproduct to Count Dates Ignoring Blanks

    D3:
    Please Login or Register  to view this content.
    Quang PT

+ 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] Count duplicates in a range ignoring blanks
    By bjnockle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-14-2021, 12:37 AM
  2. [SOLVED] SUMIF, ignoring blanks and find earliest date ignoring blanks
    By Chris_Devon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2019, 10:16 AM
  3. [SOLVED] Count or Sum Ignoring Specified Text & Blanks
    By mycon73 in forum Excel General
    Replies: 3
    Last Post: 11-24-2018, 03:26 AM
  4. Replies: 14
    Last Post: 04-25-2017, 03:11 AM
  5. Combine Dates from 10 Columns While Ignoring Blanks
    By DKGODFREY in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-16-2014, 11:50 AM
  6. Replies: 2
    Last Post: 12-04-2014, 06:25 AM
  7. Replies: 2
    Last Post: 12-04-2014, 06:22 AM

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