+ Reply to Thread
Results 1 to 11 of 11

Simple SUM array formula doesn't work. Bug?

  1. #1
    Registered User
    Join Date
    07-05-2016
    Location
    Praha, The Czech Republic
    MS-Off Ver
    2013
    Posts
    4

    Question Simple SUM array formula doesn't work. Bug?

    Problem.PNG

    So basically, with this formula I want to SUM amounts if it meets criteria either Office="Oregon" OR difference<0. If I use OR function in single cell reference formula and copy down, Everything works fine, although if I try apply array formula, it doesn't work. I have found out, that if I use IF function in array formula instead, suddenly I get the correct answer. Does someone know, why array formula doesn't work, when I used OR?

    Thank you.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Simple SUM array formula doesn't work. Bug?

    Why do you need an array formula? Can't you use SUMIFS?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-05-2016
    Location
    Praha, The Czech Republic
    MS-Off Ver
    2013
    Posts
    4

    Re: Simple SUM array formula doesn't work. Bug?

    Quote Originally Posted by AliGW View Post
    Why do you need an array formula? Can't you use SUMIFS?
    Of course I could, but that's not the point. I was wondering why it doesn't work, as it clearly should

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Simple SUM array formula doesn't work. Bug?

    SUMPRODUCT if you want OR
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Simple SUM array formula doesn't work. Bug?

    Can you post this file?

  6. #6
    Registered User
    Join Date
    07-05-2016
    Location
    Praha, The Czech Republic
    MS-Off Ver
    2013
    Posts
    4

    Re: Simple SUM array formula doesn't work. Bug?

    Quote Originally Posted by Special-K View Post
    Can you post this file?
    Sure, here it is.
    Attached Files Attached Files

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Simple SUM array formula doesn't work. Bug?

    Hi,

    OR will only return one True/False value and not the array of values you would require for your SUM formula to calculate as you want.

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

    Re: Simple SUM array formula doesn't work. Bug?

    Quote Originally Posted by Zahum
    Does someone know why array formula doesn't work, when I used OR?
    Because OR and other logical functions return a single result, not an array of results.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Simple SUM array formula doesn't work. Bug?

    If you change all the names to ranges and use INDIRECT,
    e.g.
    in G12
    =SUM(OR(INDIRECT("B2:B"&H14)="Oregon",INDIRECT("f2:f"&H14)<0)*INDIRECT("c2:c"&H14))
    and use H14 as an manual index you can see how its adding up individually

    even though columns G and H have 0 the amount in column C is still being summed, hence the difference of 3315 (C7, C10, C11)

  10. #10
    Registered User
    Join Date
    07-05-2016
    Location
    Praha, The Czech Republic
    MS-Off Ver
    2013
    Posts
    4

    Re: Simple SUM array formula doesn't work. Bug?

    I see! I didn't know about this. Thank you!

  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: Simple SUM array formula doesn't work. Bug?

    Try this...

    =SUMPRODUCT(SIGN((Office="Oregon")+(Difference<0)),Amount)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Array formula doesn't work (CTRL+SHIFT+ENTER)
    By Ztv in forum Excel Formulas & Functions
    Replies: 65
    Last Post: 04-07-2021, 12:29 AM
  2. [SOLVED] IF formula in ARRAY = works <> doesn't work
    By bkanealy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-02-2014, 09:31 AM
  3. [SOLVED] weekday() result used in an array formula doesn't work. Formula works if i type in date
    By aarco50 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-25-2014, 03:25 PM
  4. Excel 2007 : CSE Array Formula doesn't work
    By srschiller in forum Excel General
    Replies: 12
    Last Post: 11-17-2011, 04:35 PM
  5. Confirming array formula (CTRL+SHIFT+ENTER) doesn't work
    By Vbort44 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-11-2008, 07:18 PM
  6. I'm sure this is simple...but doesn't work
    By tralala in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-29-2006, 09:51 PM
  7. (Very) Simple Formula Doesn't Work
    By Erehwon in forum Excel General
    Replies: 5
    Last Post: 03-21-2006, 09:35 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