+ Reply to Thread
Results 1 to 9 of 9

COUNTIF/SUMPRODUCT unique dates+....

  1. #1
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    COUNTIF/SUMPRODUCT unique dates+....

    Hi Excel pro's!
    I can't seem to put some bits of formulas together to do the whole job.

    I have a list of dates in range A1:A3000.
    The dates span 7 years, some date cells in the range are blank, some dates appear more than once.

    I want to count:
    Number of UNIQUE dates
    that are Sunday
    in a specified year (so the result will always be less than 52)
    and don't fall between the dates specified in cell B2 and B3 (holiday week)

    It needs to ignore the blank cells in the range.

    Thanks so much everyone.

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: COUNTIF/SUMPRODUCT unique dates+....

    You've 2016 so use PowerQuery (Get&Transform)

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: COUNTIF/SUMPRODUCT unique dates+....

    Try

    =SUMPRODUCT((WEEKDAY(A1:A3000)=1)*(YEAR(A1:A3000)=B1)*((A1:A3000<B2)+(A1:A3000>B3))*((A1:A3000<>"")/COUNTIF(A1:A3000,A1:A3000&"")))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    Re: COUNTIF/SUMPRODUCT unique dates+....

    Like a charm.

    Legend

    Thank you

  5. #5
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    Re: COUNTIF/SUMPRODUCT unique dates+....

    Further questions:

    1) What is the correct way to add a criteria to the SUMPRODUCT so that it ignores entries where cell B includes the word "No" anywhere in the text string.
    With COUNTIF I would use: (B1:B3000,"<>*No*")

    For example:
    =SUMPRODUCT((WEEKDAY(A1:A3000)=1)*(B1:B3000,"<>*No*")*(YEAR(A1:A3000)=B1)*((A1:A3000<B2)+(A1:A3000>B3))*((A1:A3000<>"")/COUNTIF(A1:A3000,A1:A3000&"")))

    2) What is the correct way to add a criteria for getting it to ignore entries where the date in A matches the date in cell G1.
    (A1:A3000,"<>"&G1)

    Thanks so very much

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: COUNTIF/SUMPRODUCT unique dates+....

    1) Include the extra parameter *(ISNUMBER(SEARCH("No",A1:A5)))

    2) Include the extra parameter *(A1:A3000<>G1)

  7. #7
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    Re: COUNTIF/SUMPRODUCT unique dates+....

    Hi Special-K
    Thanks

    Number 2 works perfectly.
    Re Number 1: *(ISNUMBER(SEARCH("No",A1:A5)))
    Is this counting or excluding those cells that have "No" in the cells A1:A5 ??

    I want it to exclude cells that contain the word "No" anywhere within the text string of that cell.
    For example, all of the following would be excluded: 'No cars' 'cars that say no', 'little no big'

    THANKS

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: COUNTIF/SUMPRODUCT unique dates+....

    Oops! Good point, it's including, it should probably be

    *(NOT(ISNUMBER(SEARCH("No",A1:A5))))

  9. #9
    Registered User
    Join Date
    12-04-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    79

    Re: COUNTIF/SUMPRODUCT unique dates+....

    Ah ha, spot on, thank you.
    Learnt loads from this thread and hugely appreciate your time

+ 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. Assign unique ID to sorted, unique dates
    By Pigeras in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-21-2018, 01:09 PM
  2. [SOLVED] Count Unique Number of Dates, Excluding Designated Holidays and Weekend Dates
    By Winship in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-07-2017, 08:37 AM
  3. countif unique dates
    By aylar3205 in forum Excel General
    Replies: 9
    Last Post: 01-26-2016, 02:16 PM
  4. [SOLVED] Countif (or maybe it's Sumproduct?) meets two criteria and between two dates
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-14-2014, 12:50 PM
  5. [SOLVED] Sumproduct or Countif when 1) counting between dates, & 2) adding the values that fall in
    By MartinGTC in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 10-25-2013, 06:29 PM
  6. [SOLVED] SUMPRODUCT with COUNTIF to find unique entries
    By crzu in forum Excel General
    Replies: 20
    Last Post: 11-15-2012, 10:04 PM
  7. # of unique dates per unique list entry
    By MrNovice in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-27-2009, 07:01 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