+ Reply to Thread
Results 1 to 9 of 9

Combining SUMIFS with SUBTOTAL

  1. #1
    Registered User
    Join Date
    03-02-2010
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    35

    Combining SUMIFS with SUBTOTAL

    I have a spreadsheet that has the following wonderful SUMPRODUCT formula that only calculates based on visible cells which I would like to achieve with the same effect by using the new SUMIFS with SUBTOTAL functions.

    =SUMPRODUCT(--ISTEXT(G4:G34),--(J4:J34>100),SUBTOTAL(103,OFFSET(G4:G34,ROW(G4:G34)-MIN(ROW(G4:G34)),,1))*(P4:P34))

    I would prefer to use SUMIFS as it delivers the results much faster. Any help is much appreciated.
    Last edited by e_lad; 09-15-2011 at 12:20 PM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Combining SUMIFS with SUBTOTAL

    You can't use expressions in SUMIF/SUMIFS, such as ISTEXT(rng), so you are stuck with SUMPRODUCT.

  3. #3
    Registered User
    Join Date
    03-02-2010
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Combining SUMIFS with SUBTOTAL

    What about using those wildcard alternative such as...

    =SUMIFS(P4:P34,G4:G34,"=*",J4:J34,">100",...

    How would you implement the SUBTOTAL function into the above formula to enable it to only calculates based on filtered visible cells?
    Last edited by e_lad; 09-15-2011 at 01:37 PM.

  4. #4
    Registered User
    Join Date
    03-02-2010
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Combining SUMIFS with SUBTOTAL

    Can anyone help on this?

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719

    Re: Combining SUMIFS with SUBTOTAL

    Quote Originally Posted by Bob Phillips View Post
    You can't use expressions in SUMIF/SUMIFS, such as ISTEXT(rng), so you are stuck with SUMPRODUCT.
    Bob's right, you can't use SUMIFS unless you are prepared to add a helper column, e.g. in Z4 copied down use

    =SUBTOTAL(102,P4)

    then you can use SUMIFS based on that column as well as your other criteria

    =SUMIFS(P4:P34,G4:G34,"?*",J4:J34,">100",Z4:Z34,1)
    Last edited by daddylonglegs; 09-15-2011 at 04:52 PM.
    Audere est facere

  6. #6
    Registered User
    Join Date
    03-02-2010
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Combining SUMIFS with SUBTOTAL

    That's a shame...I was really hoping that I could introduce SUBTOTAL within SUMIFS just like SUMPRODUCT.

    I don't think adding another column for SUBTOTAL will be neat so it looks like I will have to resort to SUMPRODUCT again. The only problem with this is...it can get really slow as I intend to have quite a number of these formulas with large amount of data

    Thanks Daddylonglegs

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Combining SUMIFS with SUBTOTAL

    Then use helper columns as the insect suggested, you can always hide those columns. SUMPRODUCT should be avoided where performance becomes an issue.

  8. #8
    Registered User
    Join Date
    03-02-2010
    Location
    London, UK
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Combining SUMIFS with SUBTOTAL

    I'll give it a go anyway so see what it looks like. Thanks for the help.

    For once, I wasn't quite sure what insect you were on about...then I realised when I scrolled back up to see Daddylonglegs's staring at me :-)

  9. #9
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Combining SUMIFS with SUBTOTAL

    Quote Originally Posted by e_lad View Post
    For once, I wasn't quite sure what insect you were on about...then I realised when I scrolled back up to see Daddylonglegs's staring at me :-)
    I couldn't quite bring myself to spell it out

+ 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