SUMPRODUCT counts filtered-out rows unless its formula checks visibility. Multiply quantity by price in a helper column, then total it with SUBTOTAL(109,…). That skips filtered and manually hidden rows.
A single-cell SUMPRODUCT formula can do the job too, using SUBTOTAL with a separate reference for each row. Choose the helper method when the workbook needs to be easy to check, or the combined formula when adding a column isn't practical.
In this guide
1. Calculate each row's amount in a helper column
Suppose quantities are in B2:B10 and unit prices are in C2:C10. Put Amount in D1. In D2, enter this formula, then fill it down through D10:
=B2*C2
Each row now shows its quantity multiplied by its own price. Keep the heading in row 1 and the summary outside the rows being filtered, so you can still see the answer after changing the filter.

In an empty summary cell outside that block, enter:
=SUBTOTAL(109,D2:D10)
The number 109 asks SUBTOTAL to add the referenced values while ignoring manually hidden rows. Rows removed from view by a filter are excluded too. Change D2:D10 to the amount cells in your own sheet.
Use a filter condition that leaves a few records visible, then add their amounts yourself and compare. The summary should match those visible amounts. Remove the filter; the total should include the full list again.
I'd use this layout for a workbook other people maintain. The row amounts remain visible beside their inputs, so someone can spot a wrong price or quantity without taking apart a long combined formula.
If the summary doesn't change, check that the filter actually hides rows within D2:D10 and that the formula includes every amount cell. A filter over a different block can't control this calculation.
2. Use the combined formula when a helper column won't fit
For the same B2:B10 quantities and C2:C10 prices, this is the single-cell alternative for excluding filtered-out rows:
=SUMPRODUCT(B2:B10,SUBTOTAL(9,OFFSET(C2:C10,ROW(C2:C10)-MIN(ROW(C2:C10)),0,1)))
An owner confirmed this formula worked in an Excel discussion. Replace every reference consistently when adapting it to your worksheet.
SUBTOTAL checks the price cells one row at a time. A row hidden by the filter contributes zero. SUMPRODUCT multiplies the remaining price values by their corresponding quantities and adds the results.
OFFSET gives SUBTOTAL a separate cell reference for each row, while ROW gives it the row numbers. They let SUBTOTAL respond to each record's visibility instead of calculating a single price total for the entire range.
The 9 version includes rows hidden manually with the Hide command. To skip those as well, change the function number inside SUBTOTAL from 9 to 109. Keep the rest of the formula the same.
Enter the formula in a summary cell outside its input ranges. A cell within B2:B10 or C2:C10 would replace one of the values it needs and could make the formula use its own result as an input.
If your Excel expects semicolons between function arguments, use those instead of the commas shown. The colon inside a reference such as B2:B10 still means all cells between the two endpoints.
3. Decide what hidden means in this workbook
A worksheet filter and the row Hide command both remove records from sight, but SUBTOTAL treats them differently depending on its function number. Decide which behavior the report needs before judging the result.
The SUBTOTAL reference distinguishes the two sum options: 9 includes manually hidden rows, while 109 excludes them. Both exclude rows hidden by filtering.
For a report titled visible sales, 109 usually matches what the person reading the sheet expects. For a report that hides internal detail manually but still includes it in totals, 9 may be the intended choice.
Hiding a column isn't the same operation. SUBTOTAL's hidden-row behavior works vertically; hiding the price column doesn't remove all its records from the calculation.
Also check that you're filtering the original records rather than looking at a copied result on another sheet. A formula referencing the original data follows visibility there, not the appearance of an unrelated report.
To set up record selection, apply an Excel filter to the complete list. The quantities and prices must stay in the same records when you filter or sort.
4. Check the inputs when the total is still wrong
The quantity and price ranges must cover the same records, with matching row counts and column counts. B2:B10 paired with C3:C11 multiplies different records even though both ranges contain nine cells.
Keep header cells and any existing grand total outside those references. A total row included among the records can count money twice, while a heading isn't a numeric input.
Check imported quantities and prices for numbers stored as text. A cell can display digits without being a numeric value. Correct the import at its source or convert the intended numbers before trusting the row amounts.
If Excel shows an error, inspect the referenced cells for that error rather than hiding it with a replacement zero. A missing price and a real zero price represent different records.
Check two familiar records
For a quick check, leave two known rows visible and multiply their quantities by their prices separately. For example, 2 at $5 plus 3 at $4 should total $22. Use your own quantities and prices; these numbers just show the arithmetic.
If the displayed answer stays unchanged even after editing one input, check the workbook's calculation settings. Even a formula that checks which rows are visible needs Excel to recalculate it.
5. Keep the formula manageable as the list grows
Use the actual record range rather than whole-column references in the combined formula. SUMPRODUCT would otherwise process many cells that aren't part of your report, making the formula harder to maintain.
When new records are added past row 10 in the example, extend the quantities, prices and any helper formulas together. Check the filter's range too, so the filter and the calculation both include the new records.
The helper method uses multiplication and SUBTOTAL without needing a dynamic-array function. The combined method likewise avoids FILTER, making it useful when colleagues use older desktop Excel versions.
When the visible records and total still disagree
For a workbook that still gives inconsistent answers, ask its author to compare one small set of visible records with the formula's exact references. Include whether rows were filtered or hidden manually and whether 9 or 109 is used.
The Short Version
Multiply quantity by price in a helper column and total it with SUBTOTAL(109,…), or use the combined SUBTOTAL/OFFSET formula inside SUMPRODUCT. Use 9 to include manually hidden rows or 109 to skip them; both skip filtered rows.
Checked November 17, 2026.







