+ Reply to Thread
Results 1 to 14 of 14

Theory Post: Array Formula Troubleshooting

  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Theory Post: Array Formula Troubleshooting

    Afternoon all,

    I've written an array formula that isn't returning what I'd expect and I'm struggling to get my head around why. The following is an example of the structure of my formula:

    {=SUM(SUMIFS(TableName[FieldW], TableName[FieldX], NamedRange(1 Cell), TableName[FieldY], NamedRange(4 Cells), TableName[FieldZ], NamedRange(3 Cells)))}

    Are there any obvious flaws in my logic?

    UPDATE: I've added an example.

    Thanks in advance,

    Snook
    Attached Files Attached Files
    Last edited by The_Snook; 03-02-2017 at 01:29 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Theory Post: Array Formula Troubleshooting

    Hard to say without seeing it in some context and some sample data
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    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,366

    Re: Theory Post: Array Formula Troubleshooting

    Your post suggests the named ranges are different sizes: with SUMIFS all ranges must be the same size.

    and no sure why SUM (SUMIFS .....)?

  4. #4
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Theory Post: Array Formula Troubleshooting

    Hi JohnTopley/FDibbins,

    I've attached an example of my query, I'd be grateful if you could point out where I'm going wrong (I think JohnTopley is already onto it).

    Thanks,

    Snook

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Theory Post: Array Formula Troubleshooting

    THis seems to work...
    =SUM(SUMIFS(Table1[[#All],[FieldX]],Table1[[#All],[FieldY]],FY,Table1[[#All],[FieldY2]],Dept,Table1[[#All],[FieldZ]],Status))
    CSE
    yours (to compare)
    =SUM(SUMIFS(TableName[FieldW], TableName[FieldX], NamedRange(1 Cell), TableName[FieldY], NamedRange(4 Cells), TableName[FieldZ], NamedRange(3 Cells)))}

  6. #6
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Theory Post: Array Formula Troubleshooting

    I'm still getting the same output value (3370).

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Theory Post: Array Formula Troubleshooting

    When you have 2 multi criteria ranges (Dept and Status) in the Sum(Sumif structure
    They must be transposed of each other
    1 a Single Row range like A1:E1
    The other a single Column Range like A1:A5

    I suggest changing Status Named Range to a row reference, say G9:I9, and populate those values in those cells.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Theory Post: Array Formula Troubleshooting

    OR transpose the range within the formula itself
    =SUM(SUMIFS(Table1[FieldX],Table1[FieldY],FY,Table1[FieldY2],Dept,Table1[FieldZ],TRANSPOSE(Status2)))

    Also FYI
    If you change SUM to SUMPRODUCT, the formula doesn't need to be entered as an array.

  9. #9
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Theory Post: Array Formula Troubleshooting

    Jonmo1 you've nailed it mate and also taught me something new!

    I'd have been staring at that for hours!

    Thanks again!

    Snook

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Theory Post: Array Formula Troubleshooting

    You're welcome.

  11. #11
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Theory Post: Array Formula Troubleshooting

    Out of interest what would happen if I had 3 multi criteria ranges?

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Theory Post: Array Formula Troubleshooting

    I am unaware of any method to do 3 or more multi criteria ranges with the sum(sumifs syntax

    You would have to do
    sumifs+sumifs+sumifs

  13. #13
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Theory Post: Array Formula Troubleshooting

    Cool, thankfully I'm not in that boat, I was just curious.

  14. #14
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Theory Post: Array Formula Troubleshooting

    For info - Transposing the range within the formula itself only works when the formula is entered as an array, e.g. {=SUM(SUMIFS.....

    When you change the SUM to SUMPRODUCT and press enter it returns 0.

+ 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] And or formula conditional formatting troubleshooting
    By kschmit1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-03-2016, 12:48 PM
  2. Theory Post: Check for formula changes between two workbooks
    By The_Snook in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-13-2016, 03:21 AM
  3. Lookup Formula Troubleshooting
    By AK de FLA in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-19-2016, 09:28 PM
  4. [SOLVED] MATRICES ISSUE: Trouble translating some geographical matrix theory into a formula
    By spanishguy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-14-2012, 01:50 PM
  5. Formula Troubleshooting - Checking two lists for matches
    By kimball.r in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-10-2012, 05:01 PM
  6. Troubleshooting Sumproduct and Countif formula
    By dcgrove in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-15-2008, 04:19 AM
  7. [SOLVED] Troubleshooting my IF formula
    By Kim in forum Excel General
    Replies: 5
    Last Post: 06-26-2006, 06:15 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