+ Reply to Thread
Results 1 to 8 of 8

Using COUNTIFS across numerous columns within a SUBTOTAL

  1. #1
    Registered User
    Join Date
    01-15-2021
    Location
    North West, England
    MS-Off Ver
    Office Version 18.2008.12711.0
    Posts
    6

    Exclamation Using COUNTIFS across numerous columns within a SUBTOTAL

    Hi All,

    Apologies if this causes any repetition, but I've looked at a number of threads around this topic and im struggling to find an answer that does exactly what im looking for here.

    I am trying to create a dynamic subtotal table at the top of a spreadsheet that counts the number of instances of given scenarios (from a big data dump below the table - Rows 18-71), where there are numerous IFs required to be met across different columns that play into the scenarios...

    e.g. I have 'Outlet Type' in Column A, & i have 'Outlet Open Status' in Column C - as well as many other fields around them in other columns like 'who owns the outlet', 'Outlet quality' or 'does it have outdoor space'' etc.

    What i want to be able to do is have the subtotal count the number of outlets that are say Open (e.g. Green), by Type (e.g. 09. Restaurant), when i then filter on other columns like 'Outlet Owner' in Column D or on Outlets that have 'Outside Seating' in Column E.

    That way, it is possible to regularly paste in the data dump, and have users see how many scenarios there are of different types over time, to help with planning.

    BUT, i cant seem to get the subtotal to give me a count other than ZERO, when there are two conditions in DIFFERENT COLUMNS.

    I want the area highlighted in Yellow on the example spreadsheet to subtotal the count of scenarios, when you filter on a column in row 18

    Could anyone help?
    Attached Files Attached Files
    Last edited by ChrisNaughton; 01-15-2021 at 12:48 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Using COUNTIFS across numerous columns within a SUBTOTAL

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    01-15-2021
    Location
    North West, England
    MS-Off Ver
    Office Version 18.2008.12711.0
    Posts
    6

    Re: Using COUNTIFS across numerous columns within a SUBTOTAL

    Edited and updated an attachment, does that help?

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Using COUNTIFS across numerous columns within a SUBTOTAL

    Maybe... perhaps... but there is no "area highlighted in yellow" to be seen... So I do not know what you want to see, or where you want to see it.

    BtW, your formula in C2 and around is not very friendly. Use this, copied across and down:

    =COUNTIFS($A$19:$A$71,$A2, $C$19:$C$71, C$1)

  5. #5
    Registered User
    Join Date
    01-15-2021
    Location
    North West, England
    MS-Off Ver
    Office Version 18.2008.12711.0
    Posts
    6

    Re: Using COUNTIFS across numerous columns within a SUBTOTAL

    Quote Originally Posted by Glenn Kennedy View Post
    Maybe... perhaps... but there is no "area highlighted in yellow" to be seen... So I do not know what you want to see, or where you want to see it.

    BtW, your formula in C2 and around is not very friendly. Use this, copied across and down:

    =COUNTIFS($A$19:$A$71,$A2, $C$19:$C$71, C$1)
    Thanks Glenn,

    I've uploaded a 2nd version of the example. Mustve not saved the highlight the first time, sorry.

    So, the highlighted range (C2 to E13) is where i want to use the subtotal with numerous IFs

    I want the table to be able to show 'How many Green Bars are there?' when you filter on Outdoor Space 'Y' in Column E for example. So the formula in C2:E13 needs to reflect 2 conditions, Green/Amber or Red AND What kind of Outlet it is (Bar/Hotel etc)

    Does that make sense?

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Using COUNTIFS across numerous columns within a SUBTOTAL

    I figured it out and have not yet looked at attachment 2.

    In B2, copied down:
    =SUMPRODUCT(($A$19:$A$71=$A2)*(SUBTOTAL(103,OFFSET($A$19,ROW($A$19:$A$71)-MIN(ROW($A$19:$A$71)),0))))

    in C2, copied across and dnown:
    =SUMPRODUCT(($A$19:$A$71=$A2)*($C$19:$C$71=C$1)*(SUBTOTAL(103,OFFSET($A$19,ROW($A$19:$A$71)-MIN(ROW($A$19:$A$71)),0))))
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-15-2021
    Location
    North West, England
    MS-Off Ver
    Office Version 18.2008.12711.0
    Posts
    6

    Re: Using COUNTIFS across numerous columns within a SUBTOTAL

    Legend! That works!

    Really appreciate the quick response and help.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Using COUNTIFS across numerous columns within a SUBTOTAL

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

+ 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. SUBTOTAL and COUNTIFS combination
    By aaron_burr in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-07-2020, 12:52 AM
  2. [SOLVED] CountIFs with SUBTOTAL
    By bhenlee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-14-2017, 08:44 AM
  3. [SOLVED] COUNTIF and COUNTIFS with SUBTOTAL
    By JFactor in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-26-2015, 05:51 PM
  4. [SOLVED] How to Subtotal Countifs with 3 criteria?
    By ExcelFledgling in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-03-2015, 03:53 PM
  5. Countifs with subtotal
    By eleaca in forum Excel General
    Replies: 5
    Last Post: 01-04-2015, 12:44 PM
  6. [SOLVED] COUNTIFS and SUBTOTAL Functions Help
    By kapeller in forum Excel General
    Replies: 8
    Last Post: 09-15-2014, 06:23 PM
  7. Subtotal and Countifs
    By pisgah in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2013, 02:14 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