+ Reply to Thread
Results 1 to 6 of 6

=Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]

  1. #1
    Registered User
    Join Date
    08-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]

    Goal: To get the total count per month of positions that have "0's" by department.

    I have found that the subtotal function will be able to do the trick for me but it doesn't have the countif function with it (only has count and counta, I want countif)

    I've searched boards and found this formula which from how i understood is the subset of the subtotal formula.

    =SUMPRODUCT(SUBTOTAL(3, OFFSET(Range,ROW(Range)-MIN(ROW(Range)),0,1)),--(Range=Criteria))

    The problem though, I don't know how to apply this.

    I've attached the spreadsheet. Please refer to the orange highlight.

    Any help appreciated!

    Thanks,
    Attached Files Attached Files
    Last edited by thomas.mapua; 01-06-2012 at 11:24 AM.

  2. #2
    Registered User
    Join Date
    11-05-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: =Subtotal(countif,Range); Subtotal and countif in 1 formula

    Using your spreadsheet try the following formula in column K orange cell and then copy across:

    =COUNTIF(K6:K24,0)-COUNTIFS(K6:K24,0,$G6:$G24,"")

    This counts the number of cells where the value is zero and deducts the number of subtotals which are zero. I think this will work for you.

    Regards,


    Simon

  3. #3
    Registered User
    Join Date
    08-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: =Subtotal(countif,Range); Subtotal and countif in 1 formula

    Simon,

    Its great it works!, one thing though when I filter it by department it's still counting the whole table.

    Do you know if there's a workaround with this?

    Thanks,

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: =Subtotal(countif,Range); Subtotal and countif in 1 formula

    To get the count of open positions for the filtered department, try this regular formula:
    K28: =SUMPRODUCT(SUBTOTAL(2,OFFSET(K$4,ROW($4:$25)-4,))*(K$4:K$25=0)*($D$4:$D$25<>""))

    copy that formula across through V28

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    08-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: =Subtotal(countif,Range); Subtotal and countif in 1 formula

    Ron,

    So complicated but it works!

    Thanks a lot!

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]

    Glad I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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