+ Reply to Thread
Results 1 to 7 of 7

SUMIFS with Array Constant Fails

  1. #1
    Registered User
    Join Date
    06-23-2010
    Location
    Cadiz, KY
    MS-Off Ver
    2016
    Posts
    6

    SUMIFS with Array Constant Fails

    Hello folks, many hours trying to figure what I am missing. Notice in the formula below that one of the SUMIFS criteria is an array constant {"MCH","IGT","STT"}

    Please Login or Register  to view this content.
    That works fine. However, assume the array constant is elsewhere in a cell named 'fPlants'. I cannot figure out why the formula below will not work - it sums to zero which is incorrect

    Please Login or Register  to view this content.
    If I step through the formula using Evaluate Formula, notice below that there are extra quotes added to the array constant

    Formula.jpg

    What am I doing wrong? Any advise would be appreciated
    Last edited by zCJH4254; 07-20-2014 at 02:39 AM. Reason: Incorrect title

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: SUMIFS with Array Constant Fails

    Can you post a copy of a sample of the sheet, not a jpg?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: SUMIFS with Array Constant Fails

    Try this..
    I think I will do..


    Formula: copy to clipboard
    Please Login or Register  to view this content.




    Don't forget to click *
    Last edited by Vikas_Gautam; 07-20-2014 at 10:11 AM.

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

    Re: SUMIFS with Array Constant Fails

    Welcome to the Forum.

    This is because your first formula is treated as a regular formula since you are passing the criteria as a direct array of values like {"MCH","IGT","STT"}, but when you pass the criteria as fPlants, the formula needs to break this names range into array of values like {"MCH","IGT","STT"}, therefore in this case the formula becomes an array formula.
    So with your second formula you need to confirm it with Ctrl+Shift+Enter instead of just Enter. i.e. select the formula cell, press F2 (Function Key), hold down the Ctrl+Shift together and then press Enter.
    When you enter an array formula correctly, you will notice in the formula bar that the formula gets surrounded by the Curly Brackets and if you don't see the curly brackets in the formula bar, try again to confirm it as an array formula.

    Sorry if I explained it poorly.
    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.

  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: SUMIFS with Array Constant Fails

    Instead of using an array constant use cells to hold the criteria.

    A1 = MCH
    A2 = IGT
    A3 = STT

    B1 = Budget

    Then your formula would be:

    =SUMPRODUCT(SUMIFS(tData[Amount],tData[Plant],$A$1:$A$3,tData[Category],$B$1,tData[Date],X$7))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    06-23-2010
    Location
    Cadiz, KY
    MS-Off Ver
    2016
    Posts
    6

    Smile Re: SUMIFS with Array Constant Fails

    Thank you all for your help. I tried each 'solution' and the only one that worked was Tony Valko's - thanks Tony! However, I retained the SUM(SUMIF) structure and used a named range.

  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: SUMIFS with Array Constant Fails

    Quote Originally Posted by zCJH4254 View Post
    I tried each 'solution' and the only one that worked was Tony Valko's .
    That happens a lot!

    I retained the SUM(SUMIF) structure and used a named range.
    If using SUM(SUMIF you'll have to array enter the formula.

    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.

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Replies: 3
    Last Post: 10-28-2013, 06:18 AM
  2. Dynamic array constants
    By michalrosa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2010, 04:01 AM
  3. Converting weeknumber formula to VBA (array constants)
    By opopanax666 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2008, 06:23 PM
  4. Formula Array Constants, Problem
    By pegbol in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-01-2005, 02:45 PM
  5. Declaring array constants at module level
    By Microsoft Forum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2005, 03:06 PM

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