+ Reply to Thread
Results 1 to 3 of 3

Improve this formula, combo of sum, Sumifs and Sumproduct

  1. #1
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Improve this formula, combo of sum, Sumifs and Sumproduct

    I have a formula below

    Please Login or Register  to view this content.
    What this does is sum colomn H (when filtered), adds the sum of colomn G as long as there is no number in Col H next to it and the colomn J hasnt got the word "Red" in it. It then also adds the sum of Colomn D to the result.

    This took me ages to figure out and it looks far more complex than it should be, but it does do the trick....am i missing something really obvious that can shorten this code?

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,957

    Re: Improve this formula, combo of sum, Sumifs and Sumproduct

    No - that covers it. For complex situations, you need complex formulas, if you intend to use just one cell for it.
    Bernie Deitrick
    Excel MVP 2000-2010

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

    Re: Improve this formula, combo of sum, Sumifs and Sumproduct

    One very minor change you could make - SUBTOTAL allows you to specifiy multiple ranges so no reason you can't include both ranges in one SUBTOTAL function, i.e.

    =SUBTOTAL(9,$H$18:$H$190,$D$193:$D$300)+SUMPRODUCT(SUBTOTAL(9,OFFSET($G$18,ROW($G$18:$G$190)-ROW($G$18),0)),($H$18:$H$190="")+0,($J$18:$J$190<>"Red")+0)

    Other than that I agree with Bernie - you can get rid of the SUBTOTAL/OFFSET part if you are prepared to have a helper column
    Audere est facere

+ 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] Complicated SUMIFS Formula Using Dependent Combo boxes Values
    By SimonNus in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-15-2014, 04:20 AM
  2. Using Sumproduct or sumifs when a cell has a formula
    By cartica in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2013, 04:02 PM
  3. Help with SUMIFS/SUMPRODUCT Formula? for date/time
    By auswtz in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 03-31-2013, 09:47 AM
  4. [SOLVED] Complex SUMIFS (SUMPRODUCT?) formula w/ wildcards (SEARCH?)
    By markl41 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-11-2012, 02:24 PM
  5. [SOLVED] =SUMPRODUCT(SUMIFS....Formula Ammendment
    By 3smees23 in forum Excel General
    Replies: 2
    Last Post: 05-22-2012, 08:53 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