+ Reply to Thread
Results 1 to 7 of 7

OR function in SUMIFS

Hybrid View

skysurfer OR function in SUMIFS 05-09-2012, 12:00 AM
shg Re: OR function in SUMIFS 05-09-2012, 12:11 AM
skysurfer Re: OR function in SUMIFS 05-09-2012, 12:34 AM
skysurfer Re: OR function in SUMIFS 05-09-2012, 12:46 AM
shg Re: OR function in SUMIFS 05-09-2012, 12:55 AM
skysurfer Re: OR function in SUMIFS 05-09-2012, 01:27 AM
JosephP Re: OR function in SUMIFS 05-09-2012, 02:41 AM
  1. #1
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    OR function in SUMIFS

    Hi,

    Is there a way to include the OR function--or functionality--in SUMIFS criteria? I am looking for a range to satisfy three criteria: = A OR B OR C.

    I was able to build that functionality into SUMPRODUCT (thanks to excelforum!), but my goal is to optimize performance and replace all the SUMPRODUCT functions.

    Thanks,

    Lawrence

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: OR function in SUMIFS

    =sum(countif(a1:a20, {"a","b","c"}))
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Re: OR function in SUMIFS

    shg,

    How will COUNTIF will generate the sum? Assuming you meant SUMIF, can I use cell references for A, B and C. And since there are multiple conditions can I use SUMIFS?

    Thanks!

    Lawrence
    Last edited by skysurfer; 05-09-2012 at 12:39 AM.

  4. #4
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Re: OR function in SUMIFS

    shg,

    Okay, making progress!

    Got your formula to work using constants A, B and C SUM(SUMIFS) function combo. But how do I use cell references instead of constants???

    Lawrence

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: OR function in SUMIFS

    For a contiguous range,

    =SUM(COUNTIF(A1:A20, B1:D1))

    Otherwise,

    =SUM(COUNTIF(A1:A20, CHOOSE({1,2,3}, B1, C2, D3)))

    Either must be confirmed with Ctrl+Shift+Enter.

  6. #6
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    Re: OR function in SUMIFS

    shg,

    Having a difficult understanding.

    I have the following working:
    =SUM(SUMIFS(sum_range,criteria_range1,criteria1,criteria_range2,{"A","B","C"}))

    But when I replace A, B, and C with cell references, the formula fails. Is the only way to make it work to convert it into a SHFT-CTRL-ENTER array? If so, is the best I can do performance-wise is to use SUMPRODUCT?

    Anyway, really appreciate your help. How do I make the cell links work...or do you recommend SUMPRODUCT?

    Lawrence

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: OR function in SUMIFS

    you cannot use cell references as an array constant. see shg's use of choose in the last post. if still stuck I'd suggest you provide a specific example. I reckon you'd probably do as well with sumproduct or a pivot.
    Last edited by JosephP; 05-09-2012 at 02:51 AM.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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