Aggregate Function

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
81
Office Version
2019
Platform
Windows
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)
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

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
4,037
Office Version
2010
Platform
Windows
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
81
Office Version
2019
Platform
Windows
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,515
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
81
Office Version
2019
Platform
Windows
I'd got focused on using MAX, using Large worked fine. Thank you.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,548
Messages
5,469,360
Members
406,647
Latest member
ssinovec

This Week's Hot Topics

Top