Aggregate Function

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
75
From a previous post I have been using the function at the bottom of the post. I now wish to use the aggregate function again to find the Max value from a different range of cells but still based on only those records that are in a particular year. I have tried modifying the function as below to achieve this but get a #value error.

=AGGREGATE(4,6,Records!$I:$I/(YEAR(Records!$F:$F)=1994),1)

Can anyone help please ?

Dave

=AGGREGATE(15,6,Records!$F:$F/(YEAR(Records!$F:$F)=1994),1)
 

KennyGreens

Board Regular
Joined
Aug 8, 2018
Messages
142
Hi there, why did you change the first argument to 15? The number 4 there that you have as the first argument in the first formula you posted let's the function know that it is looking for the maximum value in that range. By changing it to 15, you made the formula let the function know that it is looking for the smallest value in that range. I'm not sure why this change would cause an error as I don't have the data you are looking at, but that is something I noticed looking at your formulas.
 
Last edited:

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
3,780
The formula
=AGGREGATE(15,6,Records!$F:$F/(YEAR(Records!$F:$F)=1994),1) should work OK.
 

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
75
The formula
=AGGREGATE(15,6,Records!$F:$F/(YEAR(Records!$F:$F)=1994),1) should work OK.
I apologise, my original post was confusing. The formula I am currently using =AGGREGATE(15,6,Records!$F:$F/(YEAR(Records!$F:$F)=1994),1) works great to find the earliest date in a range of cells that are in 1994.
I have tried to modify that to find the max value in a different range of cells that are linked to the original date cells.
=AGGREGATE(4,6,Records!$I:$I/(YEAR(Records!$F:$F)=1994),1) This is trying to find the max value from cells in column I that are in the same row as those in column F that are in 1994. These columns are dynamic and can have data added to and removed from them.

Hope this is a bit clearer.
 

AhoyNC

Well-known Member
Joined
Oct 10, 2011
Messages
4,344
Office Version
365
Platform
Windows
Since 4 in aggregate is MAX try dropping the 1 at the end of your formula.
AGGREGATE(4,6,Records!$I:$I/(YEAR(Records!$F:$F)=1994))
or try
AGGREGATE(
14,6,Records!$I:$I/(YEAR(Records!$F:$F)=1994),1)
14 being LARGE.

 

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
75
I'd got focused on using MAX, using Large worked fine. Thank you.
 

Forum statistics

Threads
1,082,359
Messages
5,364,919
Members
400,815
Latest member
Joaquin Phoenix

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top