+ Reply to Thread
Results 1 to 5 of 5

Subtotal countif

  1. #1
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Subtotal countif

    Should be an easy one , but just wondered how to go about the following:

    When I filter column B, I'd like the formula in A1 to take this into account & calculate a new % given the data on show

    Thanks, Mdn
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Subtotal countif

    There's probably a better alternative but here's one option:

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(A2:A251,ROW(A2:A251)-ROW(A2),0,1)),--(A2:A251="WINNER"))/SUMPRODUCT(SUBTOTAL(3,OFFSET(A2:A251,ROW(A2:A251)-ROW(A2),0,1)),--(LEN(A2:A251)>0))

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Subtotal countif

    Note that the formula from post #2 is calculating the following:
    (# cells that say WINNER) / (# cells that are not blank)

    If you wanted this:
    (# cells that say WINNER) / (# cells that say WINNER, SCRATCH, or LOSER)
    then you can use this:

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(A2:A251,ROW(A2:A251)-ROW(A2),0,1)),--(A2:A251="WINNER"))/SUMPRODUCT(SUBTOTAL(3,OFFSET(A2:A251,ROW(A2:A251)-ROW(A2),0,1)),(A2:A251="WINNER")+(A2:A251="SCRATCH")+(A2:A251="LOSER"))

  4. #4
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Subtotal countif

    Ty Falcon excellent work

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Subtotal countif

    Happy to help. Thanks for the rep!

+ 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] How to do COUNTIF with SUBTOTAL
    By ZOZOZIAD in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 03-29-2018, 04:20 AM
  2. How to do COUNTIF with SUBTOTAL
    By ZOZOZIAD in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-28-2018, 09:02 AM
  3. Countif with Subtotal
    By cschulz349 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-11-2017, 03:14 PM
  4. [SOLVED] Countif in Subtotal
    By lemuel in forum Excel General
    Replies: 3
    Last Post: 11-06-2012, 05:14 PM
  5. [SOLVED] =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]
    By thomas.mapua in forum Excel General
    Replies: 5
    Last Post: 01-06-2012, 11:33 AM
  6. If, Countif, Subtotal...?
    By richandjo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2008, 06:44 AM
  7. > but < subtotal (3,...) or countif
    By PAR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-22-2006, 05:55 AM

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