+ Reply to Thread
Results 1 to 2 of 2

Countif only on duplicate values within date range.

  1. #1
    Registered User
    Join Date
    01-27-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2016, O365
    Posts
    97

    Countif only on duplicate values within date range.

    Good day,

    I am trying to count the number of duplicate instances of a UPC number within a 90 day date range. In the example I have attached, I am expecting a result of 4 duplicates found.

    The UPC number is present 6 times, where one is the original and should not be considered duplicate, and a 6th time where it falls outside the 90 day range in order to be counted.

    Can this be accomplished in one formula? The raw data worksheet can not be manipulated so can hold no helpers, but I am open to multiple staged formulas on the report worksheet.

    Any help or direction you can provide would be great.

    Thanks,

    Les
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Countif only on duplicate values within date range.

    Given nature of calc I would, personally, advocate the use of intermediate calc on your result tab - as you indicate you're open to...

    So, for speed, I would be inclined to do something like:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    if you need to build in some excess capacity embed some pre-emptive checks to the above to handle blanks, and ensure you return 0 (in Col B)

    in short the above is designed to both:
    a) use COUNTIF rather than COUNTIFS (so storing "key" in Col A as string thereby permitting solitary wildcard count), and
    b) to only enact the potentially expensive AGGREGATE call when necessary (i.e. potential duplicate)

    the above would return 4 (in total)

    a single cell calc of the same would be quite expensive, computationally speaking -- and a UDF would probably be more elegant / efficient.

    edit:

    final note - if the values in D are always numeric in nature, and < 16 digits, you could use this in preference to the MATCH piece in Col A of the key, which would be quicker still:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by XLent; 01-28-2020 at 05:31 AM.

+ 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] COUNTIF values in a column based on date range in another column
    By RichPee in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-03-2018, 11:48 AM
  2. Count only duplicate values one time in a date range - Pls help
    By rudswa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-10-2016, 02:37 PM
  3. Replies: 5
    Last Post: 05-04-2015, 04:36 PM
  4. COUNTIF non duplicate values that begin with TWO choices
    By LinaVa in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-03-2015, 03:18 PM
  5. [SOLVED] COUNTIF non duplicate values that begin with
    By LinaVa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-17-2014, 11:58 AM
  6. COUNTIF non duplicate values that begin with
    By LinaVa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2014, 09:23 AM
  7. Combining a Date Range COUNTIF and a general COUNTIF
    By jacobtom in forum Excel General
    Replies: 1
    Last Post: 09-15-2011, 05:06 PM

Tags for this Thread

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