KutoolsforOffice — One Suite. Five Tools. Get More Done.

Excel AGGREGATE function

AuthorSunLast modified

doc aggregate function 1

Description

Syntax and Arguments

Usage and Examples


Description

The Excel AGGREGATE function returns an aggregate of calculations such as SUM, COUNT, SMALLL and so on with the option to ignore errors and hidden rows.

Syntax and arguments

Formula syntax

=AGGREGATE(function_num, options, ref1, [ref2])

Arguments

  • Function_num: Required. A number 1 to 19 that specifies which function you want to use. Below table lists all function numbers which are available to the AGGREGATE function, first column is the function number, the second column is the function name, and the third column indicates if the relative function needs the second argument value.
  • Options: Required. A number that decides to ignore the error values or hidden rows while using the function.
  • Ref1: Required. The first numeric argument.
  • Ref2: Optional. The second numeric argument [k].
Function_num Argument
FunctionRef2
1AVERAGE 
2COUNT 
3COUNTA 
4MAX 
5MIN 
6PRODUCT 
7STDEV.S 
8STDEV.P 
9SUM 
10VAR.S 
11VAR.P 
12MEDIAN 
13MODE.SNGL 
14LARGEk
15SMALLk
16PERCENTILE.INCk
17QUARTILE.INCquark
18PERCENTILE.EXCk
19QUARTILE.EXCquark
Options ArgumentBehavior
0 or omittedIgnore SUBTOTAL and AGGREGATE functions
1Ignore hidden rows, SUBTOTAL and AGGREGATE functions
2Ignore errors, SUBTOTAL and AGGREGATE functions
3Ignore hidden rows and error values, SUBTOTAL and AGGREGATE functions
4Ignore nothing
5Ignore hidden rows
6Ignore error values
7Ignore hidden rows and error values

Return Value

The AGGREGATE function's return depends on function specified.

Notes:

If a second ref argument is required but not provided, the AGGREGATE function returns a #VALUE! error.

The AGGREGATE function does not work with 3D references.

Usage and Examples

Here lists some examples for you to understand the AGGREGATE function.

Below is the data you use

 A
134
2#NUM!
336
472
FormulaDescriptionResult
=AGGREGATE(5,6,A1:A4)Find the minimum value and ignore errors in range A1:A434
=AGGREGATE(14,6,A1:A4,2)Find the second largest value and ignore errors in range A1:A436
=AGGREGATE(15,6,A1:B1)Don’t provide the second ref argument that the SMALL function requires.#VALUE!

See screenshot shown:
doc aggregate function 2


Sample File
doc sample file


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.