+ Reply to Thread
Results 1 to 5 of 5

Summing Array Formula

Hybrid View

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    Las Vegas
    MS-Off Ver
    Excel 2007
    Posts
    10

    Summing Array Formula

    I have a tricky question. I want to be able to pull select values from a column based on a separate date column, and then sum those values. I'm using an array with the formula:

    =IF(ISERROR(INDEX($AO$5:$AO$1000,SMALL(IF(($Q$5:$Q$1000>=G5)*($Q$5:$Q$1000<G6),ROW($AO$5:$AO$1000)),ROW(5:5)),2)),0,INDEX($AO$5:$AO$1000,SMALL(IF(($Q$5:$Q$1000>=G5)*($Q$5:$Q$1000<G6),ROW($AO$5:$AO$100)),ROW(5:5)),2))

    In order to sum the values the only way I know how to do it right now is by manually adding the next row like

    =IF(ISERROR(INDEX($AO$5:$AO$1000,SMALL(IF(($Q$5:$Q$1000>=G5)*($Q$5:$Q$1000<G6),ROW($AO$5:$AO$1000)),ROW(5:5)),2)),0,INDEX($AO$5:$AO$1000,SMALL(IF(($Q$5:$Q$1000>=G5)*($Q$5:$Q$1000<G6),ROW($AO$5:$AO$100)),ROW(5:5)),2)) + IF(ISERROR(INDEX($AO$5:$AO$1000,SMALL(IF(($Q$5:$Q$1000>=G5)*($Q$5:$Q$1000<G6),ROW($AO$5:$AO$1000)),ROW(6:6)),2)),0,INDEX($AO$5:$AO$1000,SMALL(IF(($Q$5:$Q$1000>=G5)*($Q$5:$Q$1000<G6),ROW($AO$5:$AO$100)),ROW(6:6)),2))

    You can see that I have a large range of data, almost 1000 lines. Manual entry for that range is too much, so how can I set up the array sum automatically?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Summing Array Formula

    Can't you use SUMIFS?

    e.g

    =SUMIFS($AO$5:$AO$1000,$Q$5:$Q$1000,">="&G5,$Q$5:$Q$1000,"<"&G6)

    or am I missing something?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Summing Array Formula

    Am I missing something? Why not just sum all of those result cells?

  4. #4
    Registered User
    Join Date
    08-10-2011
    Location
    Las Vegas
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Summing Array Formula

    The thing was I didn't want to have results cells, over the range of 1000 cells I would would need 1000 columns of results. I didn't realize that SUMIFS would let me return values from different column than the test criteria. That does seem to do the trick. I can probably mark this as complete, except i'm still curious as to whether or not there is a way to do it with an array formula.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Summing Array Formula

    Why would you want an array formula if you can use the much more efficient SUMIFS function? Array formulas are very inefficient and should be avoided for this kind of task.
    Last edited by NBVC; 08-10-2011 at 05:06 PM.

+ 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