+ Reply to Thread
Results 1 to 6 of 6

Array versus. SUMIFS

  1. #1
    Registered User
    Join Date
    02-28-2011
    Location
    nyc
    MS-Off Ver
    Excel 2007
    Posts
    12

    Array versus. SUMIFS

    I don't see why I would need to use an array over a SUMIFS, can someone shed some light on why the Array is considered better and when I would use it?

    Thanks.

  2. #2
    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: Array versus. SUMIFS

    A few reasons, the most obvious is that you cannot use a range expression in SUMIF/SUMIFS. For example, say you want to test the year, you can't with SUMIFS. In some instances, you need to outsort some conditions that SUMIF/SUMIFS choke on, you need an array formula to do that.

    If you can, you should use SUMIF/SUMIFS, but it is not always possible with helper columns.

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,247

    Re: Array versus. SUMIFS

    SUMIFS also won't work if the source data is in a separate closed workbook.
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Array versus. SUMIFS

    Some methods may be better for certain situations while other methods could be better for other situations. An array is simply a collection of objects, whereas SUMIFS is a function. Could you give an example of a situation where you would use one or the other?
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  5. #5
    Registered User
    Join Date
    02-28-2011
    Location
    nyc
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Array versus. SUMIFS

    You mean dates dont work with SUMIFS?

    lets say you have five pieces of data, - COLOR - Amount - Date - City - Age - couldn't you mix and match this with SUMIFS?

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

    Re: Array versus. SUMIFS

    It depends on what exactly the criteria are.... so if you are looking for a specific date or a specific date range, then yes you can use SUMIFS.

    e.g.

    =SUMIFS(B:B,A:A,"Red",C:C,DATE(2011,1,1),D:D,"Toronto",E:E,">25")

    will check all those criteria to sum column B.. .where date is specifically Jan 1, 2011

    or

    =SUMIFS(B:B,A:A,"Red",C:C,">="&DATE(2011,1,1),C:C,"<="&DATE(2011,12,31),D:D,"Toronto",E:E,">25")

    will check all the criteria and for Year 2011 (or between Jan 1 and Dec 31, 2011) and sum column B.

    What Bob was saying is you can't check something like criteria is Data must be a specific month.

    e.g.

    =SUMIFS(B:B,A:A,"Red",MONTH(C:C),12,D:D,"Toronto",E:E,">25")

    This won't work to check if the month of column C is Month 12 (December). But, again, if all the dates were in a specific year, then you can use something similar to my previous example.

    i.e.

    =SUMIFS(B:B,A:A,"Red",C:C,">="&DATE(2011,12,1),C:C,"<="&DATE(2011,12,31),D:D,"Toronto",E:E,">25")

    to get all the December, 2011 dates included along with the other criteria.

    Sometimes it takes some creativity if you insist on using SUMIFS, but sometimes, Sumproduct is an easier way out... especially for smaller ranges....
    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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