+ Reply to Thread
Results 1 to 5 of 5

Getting =COUNTIFS to change when results are filtered - Please help!

  1. #1
    Registered User
    Join Date
    04-26-2021
    Location
    Chester, England
    MS-Off Ver
    2017
    Posts
    2

    Question Getting =COUNTIFS to change when results are filtered - Please help!

    Hello

    I am trying to rewrite a working =COUNTIFS so that the values update when the range is filtered, I know this means I need to use the =SUBTOTAL, SUMPRODUCT or similar function but I am really struggling to transpose my formula into this other format.

    my working formula =COUNTIFS(Input!$F$2:$F$45653,"promotor", Input!$X$2:$X$45653, "*service*")

    I am trying to set up a widget that will automatically adjust several tables and graphs based on the filters selected, hence why the absolute references and different sheets are used, so that the base data can be regularly imported into a blank sheet with the widget as a 2nd sheet.

    Any help much appreciated!

    Thanks & best

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

    Re: Getting =COUNTIFS to change when results are filtered - Please help!

    Try this: =SUMPRODUCT(SUBTOTAL(3,OFFSET(Input!$F$2,ROW(Input!$F$2:$F$45653)-ROW(Input!$F$2),0,1)),--(Input!$F$2:$F$45653="promotor"),--(Input!$X$2:$X$45653="*service*"))
    Click the * to say thanks.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Getting =COUNTIFS to change when results are filtered - Please help!

    Hello Mattmcging. Welcome to the forum.

    Unless PaulM100's answer solves for you please upload a sample workbook that is representative of what you have to work with. Also please show results of what you are trying to do.
    Dave

  4. #4
    Registered User
    Join Date
    04-26-2021
    Location
    Chester, England
    MS-Off Ver
    2017
    Posts
    2

    Re: Getting =COUNTIFS to change when results are filtered - Please help!

    Hi, thanks for the swift reply but I'm not sure the solution works.

    I've trimmed some data (about 45.5k rows!) for a sample workbook of 20 rows and uploaded here to help show what I mean. The data is related to customer comments and reviews, but they have been anonymized with names removed etc.

    On the "responses by type" table on the graphs sheet, cells B9:D9 feature your solution, but they all show a value of zero, whether I filter results or not. I have left my original working countifs in all other cells in the table to show how I want it to work, but obviously thecountifs don't change when the results on the !input sheet are filtered.

    The main filter I would use would be by postcode, so a specific region could be looked at in more detail.

    Please let me know if any further detail required.

    Thanks!
    Attached Files Attached Files
    Last edited by Mattmcging; 04-27-2021 at 02:52 AM.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Getting =COUNTIFS to change when results are filtered - Please help!

    If you are filtering column Q, use OFFSET column Q:

    B2
    =SUMPRODUCT(SUBTOTAL(3,OFFSET(Input!$Q$2:$Q$45653,ROW(Input!$Q$2:$Q$45653)-MIN(ROW(Input!$Q$2:$Q$45653)),,1)),ISNUMBER(SEARCH(A2,Input!$F$2:$F$45653))+0)

    B8:
    =SUMPRODUCT(SUBTOTAL(3,OFFSET(Input!$Q$2,ROW(Input!$Q$2:$Q$45653)-ROW(Input!$Q$2),0,1))*(Input!$F$2:$F$45653=B$7)*ISNUMBER(SEARCH("postie",Input!$X$2:$X$45653)))

    Copy down and change "postie" to relevant text criteria

    Drag accross
    Quang PT

+ 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. Are filtered COUNTIFS possible?
    By Jarvis_Cain in forum Excel General
    Replies: 1
    Last Post: 03-31-2021, 07:47 PM
  2. Using COUNTIFS Filtered Data
    By CraigMcKee in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-27-2018, 08:36 AM
  3. Histogram on filtered table, results only on filtered rows
    By Cheesecube in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 03-25-2018, 03:54 AM
  4. [SOLVED] CountIfs when filtered
    By Lexian in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-12-2018, 08:14 AM
  5. Replies: 3
    Last Post: 05-07-2017, 02:53 PM
  6. [SOLVED] COUNTIFS formula for filtered results
    By macrorookie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-04-2014, 11:55 AM
  7. CountIfs on a Filtered list?
    By Thymoolean in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2013, 08:25 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