+ Reply to Thread
Results 1 to 10 of 10

How to Subtotal Countifs with 3 criteria?

  1. #1
    Registered User
    Join Date
    08-03-2015
    Location
    Houston
    MS-Off Ver
    2013
    Posts
    4

    How to Subtotal Countifs with 3 criteria?

    Hello,

    I'm new to Excel and this forum and am stumped on how to write a formula that will count status based on the fiscal year and month submitted for a large filtered data set.

    Below is sample data with columns A=Status, E=Submitted Date, and F=Fiscal Year. How can I write a formula that will only count the total number of "Pending" statuses in FY 2015 for the month of September?

    sample.jpg

    I tried =COUNTIFS(A2:A10,"=Pending",E2:E10,MONTH(E2:E10)<>9,F2:F10,2015) on the UNFILTERED list, but it gives me "0" when it should be "2." I cannot figure out if I can add SUBTOTAL for a filtered list.

    Thanks for any help offered! Sample.xlsx
    Last edited by ExcelFledgling; 08-03-2015 at 03:00 PM. Reason: Added sample workbook

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: How to Subtotal Countifs with 3 criteria?

    Suggest you post a sample workbook with some typical data.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to Subtotal Countifs with 3 criteria?

    Not sure if this solves it, or if this was just a typo, but, remove the = from "=Pending" in the formula
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Registered User
    Join Date
    08-03-2015
    Location
    Houston
    MS-Off Ver
    2013
    Posts
    4

    Re: How to Subtotal Countifs with 3 criteria?

    Thanks, TMS. I've added a sample spreadsheet per your suggestion.

  5. #5
    Registered User
    Join Date
    08-03-2015
    Location
    Houston
    MS-Off Ver
    2013
    Posts
    4

    Re: How to Subtotal Countifs with 3 criteria?

    Quote Originally Posted by gmr4evr1 View Post
    Not sure if this solves it, or if this was just a typo, but, remove the = from "=Pending" in the formula
    Gmr4vr1, removing the "=" didn't fix it.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: How to Subtotal Countifs with 3 criteria?

    try ..

    =SUMPRODUCT(($A$2:$A$10="Pending")*(MONTH($E$2:$E$10)=6)*($F$2:$F$10=2015)) for month of June

    I believe I am correct in saying COUNTIF cannot accept MONTH as a parameter,

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: How to Subtotal Countifs with 3 criteria?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    gives 13


    Regards, TMS

  8. #8
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: How to Subtotal Countifs with 3 criteria?

    Here's another:

    Please Login or Register  to view this content.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  9. #9
    Registered User
    Join Date
    08-03-2015
    Location
    Houston
    MS-Off Ver
    2013
    Posts
    4

    Re: How to Subtotal Countifs with 3 criteria?

    Quote Originally Posted by JohnTopley View Post
    try ..

    =SUMPRODUCT(($A$2:$A$10="Pending")*(MONTH($E$2:$E$10)=6)*($F$2:$F$10=2015)) for month of June

    I believe I am correct in saying COUNTIF cannot accept MONTH as a parameter,

    SOLVED! Both JohnTopley's =SUMPRODUCT((A:A="PENDING")*(TEXT(E:E,"mm")="09")*(F:F=2015)) and GeneralDisarray's =SUMPRODUCT((A:A="PENDING")*(TEXT(E:E,"mm")="09")*(F:F=2015)) work beautifully resulting in 2 selections. THANK YOU!!!

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: How to Subtotal Countifs with 3 criteria?

    Thanks for the rep.


    Be aware that, although those two formulae may work, they should be used with care. Prior to Excel 2007, you could not use SUMPRODUCT with full column references ... they would generate an error. Although you can use full column reference in 2007 forward, it is not good practice. The reason is that SUMPRODUCT generates a matrix of the cells referenced. In this instance, you will be generating a matrix of 3 x 1 million+ cells.


    Regards, TMS

+ 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. Countifs with subtotal
    By eleaca in forum Excel General
    Replies: 5
    Last Post: 01-04-2015, 12:44 PM
  3. [SOLVED] COUNTIFS and SUBTOTAL Functions Help
    By kapeller in forum Excel General
    Replies: 8
    Last Post: 09-15-2014, 06:23 PM
  4. [SOLVED] Countifs arrays with multiple criteria and subtotal function
    By 5150 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-12-2013, 01:58 AM
  5. Subtotal and Countifs
    By pisgah in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2013, 02:14 PM
  6. Subtotal for countifs function
    By guyzk1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-02-2013, 04:39 PM
  7. SubTotal function. How do I keep reuse Subtotal criteria.
    By davidthegolfer in forum Excel General
    Replies: 0
    Last Post: 10-10-2006, 03:28 AM

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