## Sum only visible cells or rows in a filtered list

We usually apply the SUM function to sum a list of values directly. However, if you want to sum only visible cells in a filtered list in Excel, using the SUM function will include the hidden rows into the calculation. This tutorial demonstrates a formula based on the SUBTOTAL function with a specified function number to help you get it done.

#### How to sum only visible cells or rows in a filtered list?

As shown in the screenshot below, there is a fruits sales table, and you want to sum only the visible cells in column C after filtering. You can apply the following formula to get the result.

Generic Formulas

=SUBTOTAL (function_num, ref1, [ref2],...)

Arguments

Function_num (required): It is a number from 1 to 11 or from 101 to 111 that specifies which function to use for the subtotal;
Tips: the numbers 9 and 109 can be used to define the SUM function.
Ref1 (required): It is the first named range or reference for which you want to sum only the visible cells;
Ref2,... (optional): It is the named ranges or references (up to 254) for which you want to sum only the visible cells.

How to use this formula?

Select a cell, enter the formula below and press the Enter key to get the result.

=SUBTOTAL(9, C5:C13)

Or you can also apply the following formula:

=SUBTOTAL(109, C5:C13)

Note:

Difference between the function numbers 9 and 109:
9 includes manually-hidden rows into calculation, while 109 excludes them. For example, you have a list of data with manually-hidden rows (right-click > hide), to sum only the visible rows, you need to apply the SUBTOTAL function with the function number “109”.
=SUBTOTAL(109, C5:C13)

=SUBTOTAL(9, C5:C13)

#### Related functions

Excel SUBTOTAL function
The Excel SUBTOTAL function returns a subtotal in a list or database.

#### Related formulas

Sum values in horizontal range in Excel
To sum numbers in horizontal range based on a condition, you can apply the SUMIFS function. This step-by-step guide helps you to get it done.

Use SUMIFS with multiple criteria based on OR logic
By default, the SUMIFS function handles multiple criteria based on AND logic. If you want to sum multiple criteria based on OR logic, you need to use the SUMIFS function within an array constant.

Use SUMPRODUCT with IF function in Excel
This tutorial is talking about how to use IF logic with SUMPRODUCT function in Excel.

### 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 Toolsets:  12 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

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.