+ Reply to Thread
Results 1 to 4 of 4

Filtering effects on a SUMIF formula

  1. #1
    Registered User
    Join Date
    03-24-2012
    Location
    Bellport,NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Filtering effects on a SUMIF formula

    I have several SUMIF formula is my spreadsheet. The are fine when I do not turn on any filters. However, if I filer our some cell ranges, the SUNIF formula ignores what I have filters out and sums the enitre sheet including hidden data. Can this be addresed? Thanks, Lloyd

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Filtering effects on a SUMIF formula

    If you are using a formula like this

    =SUMIF(A2:A100,"x",B2:B100)

    that sums column B when column A = "x"

    to make that sum only visible rows after filtering change to

    =SUMPRODUCT(SUBTOTAL(9,OFFSET(B2,ROW(B2:B100)-ROW(B2),0))*(A2:A100="x"))
    Audere est facere

  3. #3
    Registered User
    Join Date
    03-24-2012
    Location
    Bellport,NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Filtering effects on a SUMIF formula

    Appreciate the quick response, but I'm getting an error message. My formula is =SUMIF(D1:D103,"N",E1:E103). Would the sumprodut you suggest work with a simple =SUM(E2:E98) formula as well when using filtering? Thanks again, Lloyd

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Filtering effects on a SUMIF formula

    So for that SUMIF my suggestion would become

    =SUMPRODUCT(SUBTOTAL(9,OFFSET(E1,ROW(E1:E103)-ROW(E1),0))*(D1:D103="N"))

    For a simple SUM it's not so complex, you can use SUBTOTAL on its own, i.e. instead of =SUM(E2:E98) you can use

    =SUBTOTAL(9,E2:E98)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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