+ Reply to Thread
Results 1 to 5 of 5

Count unique numbers between dates with criteria on filtered sheet

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

    Count unique numbers between dates with criteria on filtered sheet

    Hi All,

    I have a sheet that I need to count unique client numbers between two user inputted dates based on criteria in a client intention column - all on a sheet that is filtered for employee username. When the sheet is filtered, a table should show the filtered result. I've googled extensively and cannot find a version of "Count unique numbers between dates with criteria" that works for filtered sheets.

    I've attached a sample file to try to illustrate the requirements. B2 & B3 are user inputted dates. B6 is a validation list of users (or all users) to allow filtering. The criteria to be counted are in D2:D7 and formulas to be in E2:E7. I'm really quite stuck! Can anyone please assist?

    Many thanks,
    Attached Files Attached Files
    Dave C

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Count unique numbers between dates with criteria on filtered sheet

    Try these

    In E2

    =SUMPRODUCT(SUBTOTAL(2,OFFSET($D$10,ROW($D$10:$D$54)-ROW($D$10),0))*($D$10:$D$54>=$B$2)*($D$10:$D$54<=$B$3))

    In E3, then fill down to E6

    =SUMPRODUCT(SUBTOTAL(2,OFFSET($D$10,ROW($D$10:$D$54)-ROW($D$10),0))*($D$10:$D$54>=$B$2)*($D$10:$D$54<=$B$3)*($E$10:$E$54=D3))

    In E7

    =SUMPRODUCT(SUBTOTAL(2,OFFSET($D$10,ROW($D$10:$D$54)-ROW($D$10),0))*($D$10:$D$54>=$B$2)*($D$10:$D$54<=$B$3)*($E$10:$E$54=""))

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

    Re: Count unique numbers between dates with criteria on filtered sheet

    Hi Jason.b75,

    Thank you for your reply. Unfortunately your formulas do not appear to count unique client numbers. Apologies, perhaps this was because my explanation was not clear enough. I've created and attached a much clearer (I hope) set of examples to illustrate the desired outcome.

    What I'm looking for is a count of unique client numbers with a specific item intention, on a filtered sheet, between two dates.

    Many thanks,
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Count unique numbers between dates with criteria on filtered sheet

    Sorry, you did say that in your original post, I did see that but had brainfreeze and did the formula for just a regular count of filtered data.

    Thinking out of the box a little, you don't need to allow for the filter, as you have the filter criteria in B6, you can use that as part of the formula criteria as well (so long as that is actually used to filter the table. If the table filter in B9 is used to select 1 or more users instead of B6 then this will not work). If you need the formula to work with that type of filtering then it might be better to add a helper column to the lower table to identify the visible rows.

    Not that this is an array formula, so must be commited with Shift Ctrl Enter, not just Enter.

    =SUM(--(FREQUENCY(IF(($D$10:$D$53>=$B$2)*($D$10:$D$53<=$B$3)*IF($B$6="ALL USERS",1,$B$10:$B$53=$B$6)*($E$10:$E$53<>""),$C$10:$C$53),$C$10:$C$53)>0))

    The part in red can be changed to match the criteria in D2:D7

    <>"" all non blanks
    ="" all blanks
    =D3 criteria in D3, etc.

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

    Re: Count unique numbers between dates with criteria on filtered sheet

    Hi jason.b75,

    Thanks for your time and the solution - super job, it works exactly as required! I've literally spent days on this!

    Great idea on the filter criteria option as well. Filtering has always been the sticking point for a workable solution. And yes, B6 is the filter criteria/toggle.

    Many thanks again!

+ 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] Translating array formula - count unique values between dates on filtered sheet - to VBA
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-10-2018, 09:45 AM
  2. [SOLVED] Count unique values between dates on filtered sheet
    By L plates in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-25-2018, 05:29 AM
  3. count unique values based on between dates with a criteria
    By FUN2BALA in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 11-22-2017, 04:55 AM
  4. Formula to count the cell dates meeting the criteria on another sheet
    By suneeshpillai in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-22-2017, 09:16 AM
  5. Count unique dates associated to the duplicated reference numbers
    By Jockster in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-13-2015, 01:13 PM
  6. [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
  7. [SOLVED] COUNT unique reference numbers based dates in a specified date range
    By 3PDM in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-14-2012, 08:50 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