+ Reply to Thread
Results 1 to 16 of 16

Adding Criteria to a SUMPRODUCT Formula

  1. #1
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Adding Criteria to a SUMPRODUCT Formula

    Can anyone alter the formula in column L to make it so that the sum of M() and N() must be >=1 in order to make computations?

    For example: in the attached file the formula would begin summing K values at K8 because the sum of M7 & N7 >= 1.
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Adding Criteria to a SUMPRODUCT Formula

    May be this......

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: Adding Criteria to a SUMPRODUCT Formula

    In that formula the value of K7 was summed. I'm looking to sum numbers occurring after K7. So once M()+N() >=1 THEN start summing all values in the row immediately beneath. Does that make sense?

    The desired formula would produce the results in column L in this example file.
    Attached Files Attached Files

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Adding Criteria to a SUMPRODUCT Formula

    OK. Try this.......

    Please Login or Register  to view this content.
    Last edited by sktneer; 11-29-2013 at 12:41 AM.

  5. #5
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: Adding Criteria to a SUMPRODUCT Formula

    I hope this is OK by the moderators... I'm not really sure why my last thread was taken down, but I think I have to post in this thread...?

    Do you think you can help me find another formula based upon the file EXAMPLE 5A?


    I'm looking for a formula that will produce what the values of M() and N() are when M()+N() = 3.

    So.... in this example M() + N() = 3 at row 30 (or M30 + N30). Therefor the formula would produce a result of 3-0. I'm GUESSING that this formula has to be split into two columns so I figured the formulas would go in M2 & N2. M2 would = 3 and N2 would = 0.

    IF one were to copy and paste that SAME formula into AD2 & AE2, for example, AD() + AE() = 3 at row 32 (or AD32 + AE32 = 3). Thus the formula would produce the result of 1-2.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding Criteria to a SUMPRODUCT Formula

    If this is your data:

    Data Range
    M
    N
    1
    Value1
    Value2
    2
    2
    1
    3
    0
    2
    4
    4
    3
    5
    3
    0
    6
    6
    2

    Tell us what result(s) you expect and where the results should be located. Be VERY specific!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: Adding Criteria to a SUMPRODUCT Formula

    In EXAMPLE 5B you'll see:

    M2 & N2 is where I would like the formulas to be entered and the results to appear. I highlighted that green.

    The formula for each column will cover data M4 to M165 and N4 to N165. I highlighted that yellow.

    The first time where the sum of adjacent cells in columns M & N is = to "3" & what the value of each cell is is what I'm looking for. I highlighted that grey.
    Attached Files Attached Files

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding Criteria to a SUMPRODUCT Formula

    I can't download your file.

    I have a 50kb download size limit.

    Can you make up a SMALL sample file with ~20 rows worth of data?

    20 rows worth of data is plenty.

  9. #9
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: Adding Criteria to a SUMPRODUCT Formula

    Try this file.
    Attached Files Attached Files

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding Criteria to a SUMPRODUCT Formula

    OK, let's see if I understand what you want to do.

    In the smaller sample file...

    If on row 15, M15 = 2 and N15 = 1 then you want M2 to = 2 and N2 to = 1?

  11. #11
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: Adding Criteria to a SUMPRODUCT Formula

    Yes. That is correct.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding Criteria to a SUMPRODUCT Formula

    Try this array formula** entered in M2 and copied across to N2:

    =INDEX(M4:M44,MATCH(3,$M4:$M44+$N4:$N44,0))

    If no cells will sum to 3 then this version** will return a blank instead of an error:

    =IFERROR(INDEX(M4:M44,MATCH(3,$M4:$M44+$N4:$N44,0)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  13. #13
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: Adding Criteria to a SUMPRODUCT Formula

    That appears to work for those columns. Do you know how I can duplicate the same results into:

    P2 & Q2
    T2 & U2
    W2 & X2
    AA2 & AB2
    AD2 & AE2
    AH2 & AI2
    AK2 & AL2

    Copy and pasting doesn't seem to work.

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding Criteria to a SUMPRODUCT Formula

    You'll have to change the ranges accordingly:

    Entered in P2 and copied across to Q2:

    =INDEX(P4:P44,MATCH(3,$P4:$P44+$Q4:$Q44,0))

    Entered in T2 and copied across to U2:

    =INDEX(T4:T44,MATCH(3,$T4:$T44+$U4:$U44,0))

    etc
    etc
    etc

  15. #15
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: Adding Criteria to a SUMPRODUCT Formula

    I think that worked. Thanks.

  16. #16
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding Criteria to a SUMPRODUCT Formula

    You're welcome. Thanks for the feedback!

+ 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. Adding criteria to a complicated SUMPRODUCT formula
    By Sinnie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2013, 01:57 PM
  2. SUMPRODUCT not working when adding 3rd criteria
    By sheldja in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-30-2011, 04:09 PM
  3. Sumproduct OR adding criteria to Countif, Counta and Average
    By Wkruger in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-24-2010, 03:32 AM
  4. sumproduct additional information for adding another criteria
    By Darlo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2007, 11:30 AM
  5. Adding criteria to the "Sumproduct" formula
    By lionroar in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-12-2005, 01:28 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