+ Reply to Thread
Results 1 to 17 of 17

AGGREGATE returns wrong results

  1. #1
    Registered User
    Join Date
    11-28-2013
    Location
    Slovensko
    MS-Off Ver
    Excel 2016
    Posts
    8

    AGGREGATE returns wrong results

    Hi friends,
    the aggregate function should returns the minimum of specified range, for each cell in a column, but it returns wrong values.
    I have tried to change format and conditions, but the result is still wrong.

    If you can, please check attached file (in column D, used function is:
    HTML Code: 
    Thank you.
    Attached Files Attached Files
    Last edited by JozefJ; 10-25-2018 at 06:51 AM. Reason: changing the attachment file format

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: AGGREGATE returns wrong results

    Welcome to the forum!

    Attach the workbook, not a picture of it.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-28-2013
    Location
    Slovensko
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: AGGREGATE returns wrong results

    Thanks Ali

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: AGGREGATE returns wrong results

    OK - I've had a look. Please explain your desired results - how would you calculate them manually? I don't understand how you are arriving at them.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: AGGREGATE returns wrong results

    Forget that - I get it! You may need to replace commas with semi-colons for your locale in the formulae below.

    Newer versions of Excel:

    =MINIFS($D$2:$D$57,$B$2:$B$57,B2)

    Older versions:

    =MIN(IF($B$2:$B$57=B2,$D$2:$D$57))

    ... confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly brackets { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  6. #6
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: AGGREGATE returns wrong results

    For Excel2007 try array formula
    Please Login or Register  to view this content.
    Regards.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: AGGREGATE returns wrong results

    @ JozefJ

    As near as I can see your formula is working properly. I agree with Ali. How would you calculate them manually?

    I did note that the only truly blank cell in column C is C44. The rest all apparently have "" in them. I don't know if there are regional differences in Excel versions that would make this an issue or not. The non blanks return false here C43<>TEXT(,) (""<>"" ) and false here C44<>TEXT(,) (0<>"") in my version.

    And speaking of versions please update your profile. AGGREGATE was introduced in Excel 2010.
    Last edited by FlameRetired; 10-25-2018 at 06:49 PM.
    Dave

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: AGGREGATE returns wrong results

    Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

    PS As Dave has said, you should update your user profile to reflect the version of Excel that you are currently using.

  9. #9
    Registered User
    Join Date
    11-28-2013
    Location
    Slovensko
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: AGGREGATE returns wrong results

    Thank you Dave. Excuse me, Im not sure what you understand as "manually". I need cycle (or alternative to) bounded by condition of the same content in column B, for the search of a minimum of values in column C, remember this minimum, come back to first cell in column D, write in the whole range and start new cycle with new content in B.
    Ok, thanks, I will check the version.

  10. #10
    Registered User
    Join Date
    11-28-2013
    Location
    Slovensko
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: AGGREGATE returns wrong results

    Thanks Maras, I am trying your formula, but so far it doesnt work. May be because of regional diffs.

  11. #11
    Registered User
    Join Date
    11-28-2013
    Location
    Slovensko
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: AGGREGATE returns wrong results

    Quote Originally Posted by AliGW View Post
    Forget that - I get it! You may need to replace commas with semi-colons for your locale in the formulae below.

    Newer versions of Excel:

    =MINIFS($D$2:$D$57,$B$2:$B$57,B2)

    Older versions:

    =MIN(IF($B$2:$B$57=B2,$D$2:$D$57))

    ... confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly brackets { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Tank you Ali. Excuse me for a late reply. Older one, (MIN(IF( returns zeros and after applying MINIFS (C.+S.+E.) the cell is inactive, with red dotted line around.

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: AGGREGATE returns wrong results

    Quote Originally Posted by JozefJ View Post
    Hi friends,
    the aggregate function should returns the minimum of specified range, for each cell in a column, but it returns wrong values.
    ......

    Quote Originally Posted by JozefJ View Post
    Thank you Dave. Excuse me, Im not sure what you understand as "manually". I need cycle (or alternative to) bounded by condition of the same content in column B, for the search of a minimum of values in column C, remember this minimum, come back to first cell in column D, write in the whole range and start new cycle with new content in B.
    Ok, thanks, I will check the version.
    So far your responses have been a bit vague for purposes of solving this dilemma. What specific values is it returning .... type those in manually in their respective locations and post that workbook so we can see where and what those "wrong values" are. Please also include a column of hand typed correct answers.

  13. #13
    Registered User
    Join Date
    11-28-2013
    Location
    Slovensko
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: AGGREGATE returns wrong results

    Quote Originally Posted by FlameRetired View Post
    So far your responses have been a bit vague for purposes of solving this dilemma. What specific values is it returning .... type those in manually in their respective locations and post that workbook so we can see where and what those "wrong values" are. Please also include a column of hand typed correct answers.
    In the first post, there is attached file aggreg2.xlsx (first sheet: desired values in column D, 2. sheet: wrong values after applying mentioned expression).

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: AGGREGATE returns wrong results

    This is from the file 1st post.

    I see no wrong answers in column D.


    A
    B
    C
    D
    1
    name1
    name2
    countOfname1
    minOfC_inRangeName2
    8
    NE-04
    40
    7
    7
    11
    PA-10
    40
    3
    3
    25
    PI-01
    40
    14
    14
    32
    A1-11
    13
    7
    7
    36
    PA-07
    41
    4
    4
    40
    PA-35
    41
    4
    4
    45
    PA-36
    41
    5
    5
    53
    PI-01
    41
    8
    8
    57
    PI-05
    41
    4
    4

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: AGGREGATE returns wrong results

    Aha!

    There are 2 sheets in the attachment! The first one is not visible at upload and it is named 'desired results(column D)'. This makes for confusing dialogue.

    It is cell C44 in the 'desired results(column D)' sheet that is causing the problem. It is really blank ... the others are not.

    Enter this in D2 of 'desired results(column D)' and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The wrong answers are as you report in D33:D57... all 0.

    Now go to cell C43 of the 'desired results(column D)' sheet, grab the fill handle and drag down one cell. All those problem cells in D33:D57 fill in with 4s.

    Does this do what you want?
    Last edited by FlameRetired; 10-30-2018 at 02:10 AM.

  16. #16
    Registered User
    Join Date
    11-28-2013
    Location
    Slovensko
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: AGGREGATE returns wrong results

    Yes, that is it How did you see the problem in C44?
    Thank you+

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: AGGREGATE returns wrong results

    When formulas don't work as expected we start examining the data for irregularities ... mismatched data types, numbers that are actually text, extra spaces etc. etc. etc...

    In this case =ISTEXT in a temporary helper column revealed this one. =ISBLANK further confirmed it.

    What I hadn't realized was the second sheet off screen to the left and that desired results(column D) and wrong results(column D) you were referring to were actual sheet names. LOL Live and learn.

    Anyway you are welcome. Glad to hear we got it resolved.

+ 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] FREQUENCY function returns wrong results
    By imatzav in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-30-2017, 05:47 AM
  2. [SOLVED] Aggregate results from multiple rows
    By Kyba in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-26-2017, 08:52 AM
  3. Replies: 9
    Last Post: 07-14-2016, 06:44 AM
  4. Retrieving results and FORECAST function - the results are wrong!
    By Lucky_G in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-03-2014, 10:57 AM
  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. [SOLVED] Need to display ONLY filtered results by use of a Sum, Vlookup and aggregate?
    By shameus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-27-2014, 04:02 PM
  7. VLookup returns N/A or wrong value
    By vindieselgal in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-08-2011, 07:20 AM

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