+ Reply to Thread
Results 1 to 9 of 9

Formulas to find duplicates to include filtering

  1. #1
    Registered User
    Join Date
    01-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    Formulas to find duplicates to include filtering

    I have the following formula to count how many duplicates are in my spreadsheet:

    =SUMPRODUCT((M7:M98<>"")/COUNTIF(M7:M98,M7:M98&"")+0)

    This works fine and identifies the number of duplicates. However I need it configured to work for when data is filtered. When I filter data the value remains the same. Can someone help me out please
    Last edited by brummingham; 01-14-2020 at 11:16 AM.

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

    Re: Formulas to find duplicates to include filtering

    Personally, I'd suggest doing the following...

    In a blank column - e.g. Z for purposes of illustration:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    your unique count then becomes:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    one key advantage of the use of SUBTOTAL in Col Z is that it negates the use of the same in the SUMPRODUCT
    SUBTOTAL embedded within a SUMPRODUCT calc also requires use of OFFSET thus making an already 'expensive' calc Volatile.

    note: if you want to exclude physically hidden rows, (e.g. rows hide), as opposed to just auto-filtered rows - change 3 to 103 in the SUBTOTAL.

  3. #3
    Registered User
    Join Date
    01-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    Re: Formulas to find duplicates to include filtering

    I did this . I created a column in N and it returned the value of 1 in each cell. I the. Made the changes to the main formula but it returned the #value error

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

    Re: Formulas to find duplicates to include filtering

    Hi, if you can, post a sample file illustrating the issue -- to do this click GoAdvanced (to reply), then click Manage Attachments and follow on screen prompts
    (unfortunately the paperclip icon doesn't work here)

    I've taken the liberty of attaching a working version of earlier proposal - in case it helps isolate the issue, your end?
    (it uses a rand to calc so if you press F9 you should see result changes to reflect latest data - to help prove it's working, conceptually)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    Re: Formulas to find duplicates to include filtering

    Your formal works. However, when I filter data the number stays the same. I need the number to change based on values in the filtered data

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

    Re: Formulas to find duplicates to include filtering

    "...when I filter data the number stays the same"
    that would only be the case if the answer remained the same... if you have the file open, as provided, and press F9 repeatedly it will change
    (not necessarily every time if the random result remains unchanged)

    note: filtering rows is a volatile action so would always instigate a re-calc if running on auto calculation

    I think it would be simplest / best for you to post your own sample, illustrating the problem(s).

  7. #7
    Registered User
    Join Date
    01-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    Re: Formulas to find duplicates to include filtering

    I can’t post the exact one due to data protection. I will try and upload a a dummy version

  8. #8
    Registered User
    Join Date
    01-10-2019
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    Re: Formulas to find duplicates to include filtering

    As you can see by the attached it recognises 5 separate names (yeah sorry included the actually word name to) but when I filter either by age if I wanted to know how many people are at that age the figure stays at five
    Attached Files Attached Files

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

    Re: Formulas to find duplicates to include filtering

    so, the attached uses the earlier suggestion; as you filter so the unique count will update drop.
    Attached Files Attached Files

+ 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. Find Duplicates After Filtering
    By Shido151 in forum Excel General
    Replies: 3
    Last Post: 02-04-2015, 04:19 PM
  2. Filtering and averages, sums
    By Cmorgan in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-07-2014, 07:05 AM
  3. Find duplicates, sum corresponsive and post the sums in a new column.
    By nissenson in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-28-2014, 10:01 AM
  4. Match/Large with Duplicates (I want to include the duplicates)
    By Willie68 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-13-2013, 01:10 PM
  5. Sums & Filtering
    By danb001 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-29-2012, 08:10 PM
  6. find duplicates for visible cells after filtering for a column
    By sravan.rathnam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2012, 06:41 AM
  7. filtering and sums
    By boyblundell in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 04-02-2009, 05:44 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