+ Reply to Thread
Results 1 to 7 of 7

OR with SUMPRODUCT

  1. #1
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    OR with SUMPRODUCT

    Does anyone know of a way to clean up the following possibly using the OR function embedded in SUMPRODUCT. I have tried various connotation with no success.

    Please Login or Register  to view this content.
    Last edited by BobTheRocker; 06-28-2016 at 05:17 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,169

    Re: OR with SUMPRODUCT

    Try

    =IF($G278="","",SUMPRODUCT(--($B$6:$B$252=$G278)*((CU$6:CU$252=$C278)+(CU$6:CU$252=$D278)+(CU$6:CU$252=$E278))))

    OR condition is implemented using "+"

    AND condition using "*"

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

    Re: OR with SUMPRODUCT

    One way...

    =IF($G278="","",SUMPRODUCT(--($B$6:$B$252=$G278),--ISNUMBER(MATCH(CU$6:CU$252,$C278:$E278,0))))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,581

    Re: OR with SUMPRODUCT

    Try
    =IF($G278="","",SUMPRODUCT(--($B$6:$B$252=$G278)*(COUNTIF($C278:$E278,CU$6:CU$252))))

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

    Re: OR with SUMPRODUCT

    Quote Originally Posted by kvsrinivasamurthy View Post
    =IF($G278="","",SUMPRODUCT(--($B$6:$B$252=$G278)*(COUNTIF($C278:$E278,CU$6:CU$252))))
    That syntax is very inefficient on large amounts of data.

    The ISNUMBER(MATCH syntax is more than twice as fast to calculate.

  6. #6
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: OR with SUMPRODUCT

    Thanks Tony, this seems to work very well.

  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: OR with SUMPRODUCT

    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. [SOLVED] Use sumproduct to further parse a sumproduct calculation
    By Araise in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2015, 08:17 PM
  2. Count SUMPRODUCT Members / Average of SUMPRODUCT
    By Shingaru in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 03:59 PM
  3. Replies: 1
    Last Post: 05-19-2012, 02:54 AM
  4. Replies: 5
    Last Post: 04-20-2012, 08:54 AM
  5. Replies: 6
    Last Post: 03-09-2011, 08:01 AM
  6. Subtract Sumproduct from a sumproduct
    By Prcntrygrl in forum Excel General
    Replies: 6
    Last Post: 01-17-2011, 02:34 PM
  7. Using a SumProduct Count to find a SumProduct Total?
    By XL021710 in forum Excel General
    Replies: 3
    Last Post: 02-18-2010, 08:31 AM

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