+ Reply to Thread
Results 1 to 13 of 13

Using COUNTIFS Filtered Data

  1. #1
    Forum Contributor
    Join Date
    10-14-2011
    Location
    London, England
    MS-Off Ver
    O365
    Posts
    180

    Using COUNTIFS Filtered Data

    Hello,

    Is it possible to user COUNTIFS on filtered data? At the moment my source data is filtered but the COUNTIFS is returning everything.

    Either that or can I dynamically copy all of the filtered data to a new sheet so this only displays the filtered data then I could get my COUNTIFS to look there?

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Using COUNTIFS Filtered Data

    You can look into a SUMPRODUCT+SUBTOTAL formula

  3. #3
    Forum Contributor
    Join Date
    10-14-2011
    Location
    London, England
    MS-Off Ver
    O365
    Posts
    180

    Re: Using COUNTIFS Filtered Data

    Thanks Paul, I'd seen some examples of that but none using COUNTIFS so didn't know if it was possible.

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Using COUNTIFS Filtered Data

    Upload a sample of your data so we can provide you a solution.

  5. #5
    Forum Contributor
    Join Date
    10-14-2011
    Location
    London, England
    MS-Off Ver
    O365
    Posts
    180

    Re: Using COUNTIFS Filtered Data

    Here you go. There is the sheet with the slicer filter on and then on the Question 1 sheet I have used a COUNTIFS to try and summarise but of course it includes everything, not just the filtered data.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Using COUNTIFS Filtered Data

    Why the .zip file? Please attach a file in normal .xls or .xlsx format - it only needs just enough data to illustrate the problem/requirement.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Using COUNTIFS Filtered Data

    Hi, to all!

    An option could be (Partial result in Question 1, for example):
    =SUMPRODUCT(SUBTOTAL(103,OFFSET(G5,ROW(G5:G19)-ROW(G5),)),N(G5:G19="Partial"))

    Blessings!

  8. #8
    Forum Contributor
    Join Date
    10-14-2011
    Location
    London, England
    MS-Off Ver
    O365
    Posts
    180

    Re: Using COUNTIFS Filtered Data

    Thanks John, I'll take a look and read through the documents for the SUMPRODUCT / SUBTOTAL / OFFSET functions as I am keen to understand.

  9. #9
    Forum Contributor
    Join Date
    10-14-2011
    Location
    London, England
    MS-Off Ver
    O365
    Posts
    180

    Re: Using COUNTIFS Filtered Data

    John, would that only result in responses from BOYS that were "Partial" though?

  10. #10
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Using COUNTIFS Filtered Data

    You can use John's formula like this:

    =SUMPRODUCT(SUBTOTAL(103,OFFSET(G5,ROW(G5:G19)-ROW(G5),)),N(G5:G19=$F22))

    $F22 instead of Partial

    Capture.JPG

  11. #11
    Forum Contributor
    Join Date
    10-14-2011
    Location
    London, England
    MS-Off Ver
    O365
    Posts
    180

    Re: Using COUNTIFS Filtered Data

    Sorry, Paul. What I'm saying is though the data has been filtered by School name so there will be boys and girls in the list. I only want to then count BOYS and PARTIAL if that makes sense so I still need a COUNTIFS equivalent.

  12. #12
    Forum Contributor
    Join Date
    10-14-2011
    Location
    London, England
    MS-Off Ver
    O365
    Posts
    180

    Re: Using COUNTIFS Filtered Data

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(E:E,ROW(E:E)-MIN(ROW(E:E)),,1)),--(F:F=M1),--(G:G=N1))

    Got it - thanks for all your help. I'm still not sure what the OFFSET does but it works!

  13. #13
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Using COUNTIFS Filtered Data

    Or you can try this:

    =SUMPRODUCT(SUBTOTAL(103,OFFSET(E6,ROW(G6:G19)-ROW(E6),0)),(G6:G19="Partial")*(F6:F19="Boy"))

+ 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] CountIfs when filtered
    By Lexian in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-12-2018, 08:14 AM
  2. how to write COUNTIFS in filtered table for shown data
    By aaaaa34 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-29-2016, 06:23 AM
  3. Replies: 5
    Last Post: 06-04-2014, 09:41 AM
  4. [SOLVED] COUNTIFS formula for filtered results
    By macrorookie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-04-2014, 11:55 AM
  5. [SOLVED] how to write COUNTIFS formula for testing only FILTERED data
    By aaaaa34 in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 03-09-2014, 07:40 AM
  6. CountIfs on a Filtered list?
    By Thymoolean in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2013, 08:25 PM
  7. COUNTIFS filtered by month
    By HeathWilD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2012, 05:06 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