How do I use the SUBTOTAL function in Excel?

The SUBTOTAL function in Excel is used to calculate a subtotal in a list or database. It can perform various functions like sum, average, count, max, min, etc., on a range of values while ignoring other SUBTOTAL functions within the range. Here's how you can use the SUBTOTAL function in Excel:

1. Syntax: The syntax for the SUBTOTAL function is `SUBTOTAL(function_num, ref1, [ref2], ...)`.
- `function_num`: This argument specifies the function to use for the subtotal. You can use numbers from 1 to 11 or 101 to 111 for different functions.
- `ref1`, `ref2`, ...: These are the references to the ranges or cells you want to include in the subtotal calculation.

2. Steps:
- Select the cell where you want the subtotal to appear.
- Enter `=SUBTOTAL(` in that cell.
- Choose the desired function number based on the operation you want to perform (e.g., 9 for sum, 1 for average, 2 for count numbers, etc.).
- Select the range of cells or type the cell references that you want to include in the calculation.
- Close the bracket `)`, and press Enter.

3. Example:
Let's say you have a list of numbers in cells A1 to A5, and you want to calculate the sum of these numbers using the SUBTOTAL function.
- In cell A6, you can enter `=SUBTOTAL(9, A1:A5)` and press Enter. This will calculate the sum of the numbers in cells A1 to A5.

Remember that the SUBTOTAL function will ignore other SUBTOTAL functions within the range you specify, which can be useful when working with filtered data.
How do I use the SUBTOTAL function in Excel?

Related Questions