Aggregate Function with Criteria

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
148
Office Version
  1. 2021
Platform
  1. Windows
I am using Excel 2016 not 365.

I have been using the following formula to find the largest ( max ) value from a range of cells which are within a particular year. =AGGREGATE(14,6,Records!$I$2:$K$40000/(YEAR(Records!$F$2:$F$40000)=1992),1)

I now wish to SUM or COUNT the values from the same range, again with a particular year. I have tried modifying the formula as in the 2 attempts below but get a #VALUE ! error for both.

=AGGREGATE(9,6,Records!$I$2:$K$40000*(YEAR(Records!$F$2:$F$40000)=1992))
=AGGREGATE(9,6,Records!$I$2:$K$40000/(YEAR(Records!$F:$F)=1992))

Any help on this would be much appreciated.
 

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.
I got fixed on trying to get Aggregate to work, never thought about Sumproduct. It worked fine, thanks very much.
For my understanding what is the reason you chose to use that formula, or is it that Aggregate just wasn't suitable ?

Thanks again.
 
Upvote 0
Function 9 in aggregate won't work with an array, only a range.
 
Upvote 0
I got fixed on trying to get Aggregate to work, never thought about Sumproduct. It worked fine, thanks very much.
For my understanding what is the reason you chose to use that formula, or is it that Aggregate just wasn't suitable ?

Thanks again.

You are welcome. Indeed not suitable for 9 (the sum function), as Rory word, does not process array objects while ordinary SUM would.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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