Excel Filtered Sum: How to Add Only Visible Values

Excel Filtered Sum — How to Accurately Add Only Visible Values

When you need an Excel filtered sum, use SUBTOTAL or AGGREGATE. Here are solutions for each situation, including excluding hidden rows, ignoring errors, and conditional sums.

Quick Fix: 90 Seconds

=SUBTOTAL(9, D2:D999)   
=SUBTOTAL(109, D2:D999)  
=AGGREGATE(9, 6, D2:D999) 

How SUBTOTAL Works (9 vs. 109)

9 calculates a sum, while 109 also excludes manually hidden rows. Use SUBTOTAL consistently for totals in filtered ranges.

Ignore Errors with AGGREGATE

=AGGREGATE(9,6,D2:D999)

Sum Only Visible Values with Criteria

=SUMPRODUCT(SUBTOTAL(103,OFFSET($A$2,ROW(A2:A999)-ROW($A$2),0))*($B$2:$B$999="Seoul")*($D$2:$D$999))

Automatically Expand with Tables and PivotTables

  • Table Total Row: Ctrl+T → Table Design > Total Row.
  • PivotTable: Insert a PivotTable using the table as the source, then set the value field to Sum.

Practical Examples

// Sum of visible amounts
=SUBTOTAL(109, D2:D999)

// Sum of visible values while ignoring errors
=AGGREGATE(9, 6, D2:D999)

Troubleshooting

IssueCauseSolution
Total does not changeUsing SUMUse SUBTOTAL or AGGREGATE
Includes manually hidden rowsUsing 9Change to 109
Fails because of an error#DIV/0! or similarUse AGGREGATE(9,6,range)
Need a conditional sumSUBTOTAL alone is limitedUse SUMPRODUCT+SUBTOTAL(103)
New rows are omittedFixed rangeUse a table (Ctrl+T) or PivotTable

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *