+ Reply to Thread
Results 1 to 4 of 4

Value Error in Aggregate for Sum function

  1. #1
    Forum Contributor
    Join Date
    08-20-2019
    Location
    Mumbai
    MS-Off Ver
    Office 365
    Posts
    101

    Value Error in Aggregate for Sum function

    Hi,

    I am trying to use Aggregate function for calculating SUM using a criteria.

    The product codes are in C2:C15
    The qty sold are in D2:D15

    I am using the below formula:
    =AGGREGATE(9,6,D2:D15*(C2:C15=C17))

    C17 = has the product code for which I want to find the sum of qty.

    When I select the array argument of the Aggregate function in the above formula (i.e. D2:D15*(C2:C15=C17)) and press F9, i get : {0;0;92;0;106;0;0;0;0;0;0;108;0;0}

    Why the Aggregate function is not returning the sum of the values in the above array?
    I even tried using division instead of multiplication in the array. i.e. D2:D15/(C2:C15=C17)

    Pls help.

    rgds
    hemant
    Attached Files Attached Files

  2. #2
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Value Error in Aggregate for Sum function

    Hi, hemantparmar!

    the AGGREGATE function only works with arrays with operations between 14 and 19.

    If you want to sum with condition, you can use SUMPRODUCT or SUMIF instead:

    =SUMPRODUCT(D2:D15,--(C2:C15=C17))
    =SUMIF(C2:C15,C17,D2:D15)

    Blessings!

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Value Error in Aggregate for Sum function

    Why AGGREGATE over SUMIF?

    You can use this:

    =SUMIF(C2:C15,C17,D2:D15)

  4. #4
    Forum Contributor
    Join Date
    08-20-2019
    Location
    Mumbai
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Value Error in Aggregate for Sum function

    Thanks guys, I was just trying to use Aggregate as single formula to do multiple other things with all arguments as variables. Forgot about the Array part for functions. Now I am clear.

+ 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] using aggregate with index giving num error ??
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-28-2019, 10:59 AM
  2. Object required error AGGREGATE COLUMNS TO ARRAY FUNCTION
    By LeoDan in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-30-2016, 02:50 PM
  3. Aggregate error
    By giscosta_br in forum Excel General
    Replies: 1
    Last Post: 05-24-2016, 07:46 AM
  4. Aggregate Function - Value Error
    By gtbaseball7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2015, 02:09 PM
  5. [SOLVED] Using Aggregate results in #NAME? error
    By y_not in forum Excel General
    Replies: 6
    Last Post: 07-30-2014, 08:26 AM
  6. Aggregate error
    By TomBP in forum Access Tables & Databases
    Replies: 3
    Last Post: 12-15-2010, 04:52 PM
  7. SQL - As part of an aggregate function ERROR
    By dave k in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2005, 12: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