+ Reply to Thread
Results 1 to 6 of 6

Exclude Filtered Rows in SUBTOTAL

  1. #1
    Registered User
    Join Date
    03-10-2016
    Location
    Menlo Park, California
    MS-Off Ver
    Professional Plus 2010
    Posts
    3

    Exclude Filtered Rows in SUBTOTAL

    Hello,

    I need to exclude filtered rows in a subtotal formula.

    I have seen solutions using SUMPRODUCT and OFFSET but I'm having a problem figuring out how to use this solution with my specific example.

    I have a spreadsheet with 3 columns. All input is contained in A5:C14. Column A contains a flag ("x") that is manually entered. Column B contains labels that I filter on. Column C contains amounts. Once I filter on specific labels in column B, I would like to sum only the rows that contain "x" in column A and ignore any hidden rows in my sum.

    Here are the solutions I found on another post (substituting # for the data I need to enter):

    =-SUMPRODUCT(SUBTOTAL(3,OFFSET(##,ROW(##:##)-ROW(##),,1)),-(##:##=#),(##:##))

    or

    =SUMPRODUCT(SUBTOTAL(9,OFFSET(##,ROW(##:##)-ROW(##),0)),--(##:##=#))

    Can anyone help fill in the #'s to fit my example above?

    Thanks!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Exclude Filtered Rows in SUBTOTAL

    =SUMPRODUCT(SUBTOTAL(9,OFFSET(C5,ROW($C$5:$C$14)-ROW(A5),0)),--(C5:C14))

    or

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(C5,ROW(C5:C14)-ROW(C5),,1)),(C5:C14))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    03-10-2016
    Location
    Menlo Park, California
    MS-Off Ver
    Professional Plus 2010
    Posts
    3

    Re: Exclude Filtered Rows in SUBTOTAL

    Thank you. This is looking better. I got a number, rather than a VALUE error. Both formulas are summing column C for all of the filtered rows. I would like to see a sum for only the rows that contain "x" in column A. Is there a way to do that?

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Exclude Filtered Rows in SUBTOTAL

    Try
    =SUMPRODUCT(SUBTOTAL(9,OFFSET(C5,ROW($C$5:$C$14)-ROW(A5),0)), (A5:A14="x")*(C5:C14))

    or

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(C5,ROW(C5:C14)-ROW(C5),,1)),(A5:A14="x")*(C5:C14))

  5. #5
    Registered User
    Join Date
    03-10-2016
    Location
    Menlo Park, California
    MS-Off Ver
    Professional Plus 2010
    Posts
    3

    Re: Exclude Filtered Rows in SUBTOTAL

    This works perfectly. Very impressive !

    Thanks so much and I will mark as solved and click on Add Reputation.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Exclude Filtered Rows in SUBTOTAL

    Thanks, 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)

Similar Threads

  1. [SOLVED] Count a filtered list but exclude the zeros
    By clarcombe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-25-2014, 04:14 AM
  2. Count values in column but exclude filtered rows
    By elee532 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-26-2013, 12:53 AM
  3. Subtotal - Delete zero Subtotal and prior rows that calculate to that zero Subtotal
    By Whatsherface in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2012, 08:37 PM
  4. copy visible cell and exclude subtotal
    By sheryar in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-07-2010, 06:09 AM
  5. SUBTOTAL - exclude zeros?
    By john_t_h in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-16-2007, 08:58 PM
  6. [SOLVED] HOW DO I TOTAL A FILTERED LIST TO EXCLUDE THOSE EXCLUDED BY FILTE.
    By Charlie in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 07:05 PM

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