+ Reply to Thread
Results 1 to 4 of 4

Count unique values between dates on filtered sheet

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Count unique values between dates on filtered sheet

    Hi All, I found a formula to count unique values between dates here - https://www.extendoffice.com/documen...een-dates.html - but can't seem to find a formula that will do this on a filtered sheet.

    Can anyone point me in the right direction?

    Many thanks in advance.
    Dave C

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Count unique values between dates on filtered sheet

    Try this:

    =SUM(IF(FREQUENCY(IF(SUBTOTAL(103,OFFSET(A2,ROW(A2:A8)-ROW(A2),,1)),IF((B2:B8>=E1)*(B2:B8<=E2),MATCH("~"&A2:A8,A2:A8&"",0))),ROW(A2:A8)-ROW(A2)+1),1)) Ctrl Shift Enter

    Source:
    https://www.extendoffice.com/documen...ed-column.html

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Count unique values between dates on filtered sheet

    Alternatively, you can create a helper column (I put it into column Z) using this formula:

    Z2 =--(AND(B2>=E$1,B2<=E$2,COUNTIF(A$2:A2,A2)=1))

    After dragging that formula down through Z8, you can use this simple SUBTOTAL formula to return the desired result:

    =SUBTOTAL(109,Z2:Z8)

    Note that this is assuming the same structure as the data in your link (ID's in column A, Dates in column B, and start/end date in E2 and E3.

  4. #4
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Count unique values between dates on filtered sheet

    Hi 63falcondude. Thanks for the reply and useful formula. Ironic that you found it at the same site!

    I have used the first formula with success as I would rather avoid using helper columns but am having difficulty translating the formula into VBA with a variable row. I will post this new issue in the VBA forum and link them once posted.

    The link to my VBA query for this formula is here: https://www.excelforum.com/excel-pro...ml#post4888057

    Many thanks
    Last edited by L plates; 04-25-2018 at 05:49 AM. Reason: Added link to related VBA query

+ 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. Count Unique values after being filtered
    By tylert in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-04-2014, 11:05 PM
  2. How to count unique values in filtered list?
    By Cayenne in forum Excel Charting & Pivots
    Replies: 14
    Last Post: 10-23-2014, 04:58 PM
  3. [SOLVED] Macro to count unique values in a column with pop up message box - sheet will be filtered
    By excel151515 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2014, 10:53 AM
  4. Count unique, visible values in a filtered column
    By kajakk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-07-2013, 08:42 AM
  5. count unique values in filtered column
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-09-2013, 10:40 AM
  6. Count Unique Values in a Filtered Column
    By mashley in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-30-2008, 10:56 AM
  7. Count Unique Values In A Filtered Row with Duplicates
    By jcpotwor in forum Excel General
    Replies: 1
    Last Post: 01-12-2006, 09:10 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