Aggregate Function

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
148
Office Version
  1. 2021
Platform
  1. 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)
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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:
Upvote 0
The formula
=AGGREGATE(15,6,Records!$F:$F/(YEAR(Records!$F:$F)=1994),1) should work OK.
 
Upvote 0
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.
 
Upvote 0
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.

 
Upvote 0
I'd got focused on using MAX, using Large worked fine. Thank you.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top