+ Reply to Thread
Results 1 to 13 of 13

Two Criteria, SUMPRODUCT Formula

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    110

    Two Criteria, SUMPRODUCT Formula

    I have the below formula, which counts all the dates that fall on month,year (AA4&Z4). And it works...


    Please Login or Register  to view this content.


    Where and how do I add, count only the ones that fall on month, year (AA4&Z4) AND that are 'ACTIVE' under Name!$G$56:$G$155
    Last edited by clprdctn; 07-27-2016 at 11:03 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Two Criteria, SUMPRODUCT Formula

    TRY

    =SUMPRODUCT(--(TEXT(Name!$BC$56:$BC$155,"yyyym")=AA4&Z4))*(Name!$G$56:$G$155="Active"))

  3. #3
    Forum Contributor
    Join Date
    02-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Two Criteria, SUMPRODUCT Formula

    It didn't work as it took the "IF and =0,NA()" function away.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Two Criteria, SUMPRODUCT Formula

    You don't need the IF .....

    Or if you want it simply replace the SUMPRODUCT statements.

  5. #5
    Forum Contributor
    Join Date
    02-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Two Criteria, SUMPRODUCT Formula

    The reason I kept is to allow the formula to display #N/A if the value is 0 so that it doesn't show up on the chart.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Two Criteria, SUMPRODUCT Formula

    =IF(SUMPRODUCT(--(TEXT(Name!$BC$56:$BC$155,"yyyym")=AA4&Z4))*(Name!$G$56:$G$155="Active"))=0,NA(),SUMPRODUCT(--(TEXT(Name!$BC$56:$BC$155,"yyyym")=AA4&Z4))*(Name!$G$56:$G$155="Active")))

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

    Re: Two Criteria, SUMPRODUCT Formula

    Try this...

    =IFERROR(1/(1/SUMPRODUCT(--(TEXT(Name!$BC$56:$BC$155,"yyyym")=AA4&Z4),--(Name!$G$56:$G$155="Active"))),NA())
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Forum Contributor
    Join Date
    02-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Two Criteria, SUMPRODUCT Formula

    Thank you John, Thank you Tony. Tony yours worked great.

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

    Re: Two Criteria, SUMPRODUCT Formula

    You're welcome. Thanks for the feedback!

  10. #10
    Forum Contributor
    Join Date
    02-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Two Criteria, SUMPRODUCT Formula

    One last question:

    Any idea how can I SUM multiple of those formulas?

    =IFERROR(1/(1/SUMPRODUCT(--(TEXT(Name!$FP$56:$FP$155,"yyyym")=AA4&Z4),--(Name!$G$56:$G$155="Active"))),NA())

    +

    =IFERROR(1/(1/SUMPRODUCT(--(TEXT(Name!$FY$56:$FY$155,"yyyym")=AA4&Z4),--(Name!$G$56:$G$155="Active"))),NA())

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

    Re: Two Criteria, SUMPRODUCT Formula

    How about putting each formula in a separate cell then sum those cells together?

    You'll have to account for the possibility that one or both formulas return #N/A.

    =SUMIF(A1:A2,"<>#N/A")

  12. #12
    Forum Contributor
    Join Date
    02-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Two Criteria, SUMPRODUCT Formula

    If possible, it'd be great to have it in one cell. I tried the following but still a no go...

    Please Login or Register  to view this content.

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

    Re: Two Criteria, SUMPRODUCT Formula

    Like this...

    =IFERROR(1/(1/(SUMPRODUCT(...)+SUMPRODUCT(...))),"N/A")

+ 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] Multiple Criteria SUMPRODUCT Formula
    By JimmyA in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-01-2016, 05:36 PM
  2. Replies: 3
    Last Post: 04-21-2015, 07:45 AM
  3. [SOLVED] I need to add a criteria to a sumproduct formula
    By sixsteps268 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2013, 11:14 AM
  4. sumproduct formula with two criteria
    By sunilmulay in forum Excel General
    Replies: 1
    Last Post: 06-18-2009, 05:25 AM
  5. Sumproduct formula - how to put the criteria together
    By Darlo in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-27-2007, 08:17 AM
  6. sumproduct formula w/ criteria
    By Scorpvin in forum Excel General
    Replies: 2
    Last Post: 02-09-2007, 12:21 PM
  7. sumproduct formula (multiple criteria)
    By Inter in forum Excel General
    Replies: 9
    Last Post: 05-18-2006, 07:50 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