Excel's SUBTOTAL function usually fails because the data contains hidden rows that are not being ignored, the function number is wrong, or the range includes other subtotals that cause double counting. The quickest fix is to check the function number (1–11 ignores manually hidden rows, 101–111 ignores all hidden rows) and confirm your range does not include a total row. Below is a step-by-step guide to diagnose and repair the most common SUBTOTAL problems.
What You'll Need
- Excel 2016 or later (desktop or Microsoft 365). The steps apply to Windows and Mac; menu labels can differ slightly by version and region.
- A worksheet with a column of numbers and, ideally, a header row.
- Basic familiarity with the formula bar and the Name Box.
Step-by-Step
- Check the function number. Click the cell with your SUBTOTAL formula. In the formula bar you will see something like
=SUBTOTAL(9, A2:A100). The first number tells Excel what to calculate and whether to ignore hidden rows. Numbers 1–11 ignore rows you hid manually but include rows hidden by a filter. Numbers 101–111 ignore both manually hidden rows and filtered-out rows. If you filtered your data and the total still includes hidden rows, change 9 to 109. - Confirm the range does not include a total row. A common mistake is selecting A2:A100 when A100 already contains a SUBTOTAL or SUM. That double-counts the total. Shrink the range to end just above the total row, or move the total outside the data range.
- Look for nested SUBTOTALs. If your range includes another SUBTOTAL formula, Excel ignores it only when it is a SUBTOTAL, not a SUM. If you used SUM inside the range, replace it with SUBTOTAL so the outer formula does not count it twice.
- Verify the data is numeric. Numbers stored as text (often left-aligned) are ignored by SUBTOTAL. Select the column, then use Data > Text to Columns and click Finish, or multiply by 1 in a helper column, to convert text to numbers.
- Check for errors in the range. If any cell in the range shows #DIV/0!, #VALUE!, or #N/A, SUBTOTAL returns an error. Fix or remove the error cells first.
- Recalculate if the result looks stale. Press F9 (Windows) or Command + = (Mac) to force a recalculation. If the formula still shows the old value, check that Calculation Options is set to Automatic under Formulas > Calculation Options.
- Test with a small range. Temporarily change the range to just two or three cells you know are correct. If SUBTOTAL works there, the problem is in the larger range—likely hidden rows, text, or a nested total.
Common Mistakes
- Using function number 9 when you meant 109 (or vice versa) and expecting filtered rows to be excluded.
- Including the grand total row inside the range, which doubles the result.
- Leaving blank rows inside the range—SUBTOTAL ignores blanks, but a blank row can hide a formatting issue that makes the range look wrong.
- Typing the range with a space instead of a colon (e.g., A2 A100 instead of A2:A100).
- Forgetting that SUBTOTAL does not work across multiple sheets in one range; use 3D references only with SUM or SUMIF, not SUBTOTAL.
Tips
- Use the Status Bar: select your numbers and look at the bottom of the Excel window. If Sum and Count appear, the data is numeric and SUBTOTAL should work.
- Press Ctrl + ` (grave accent) to show formulas and spot a nested SUM or a wrong range quickly.
- Name your data range (Formulas > Define Name) so you can update it in one place instead of editing every formula.
- For filtered lists, always use 101–111 so the total updates as you filter.
Troubleshooting
If SUBTOTAL returns 0, the range likely contains only text or blanks. Select the range and check the Status Bar—if Count is 0, there are no numbers. If it returns a wrong total, compare it with a manual SUM of the same visible cells; a difference usually means hidden rows or a nested total. If the formula shows as text (starting with an apostrophe), remove the apostrophe and press Enter. If Excel says the formula contains an error, click the warning icon and choose Show Calculation Steps to see which part fails. If none of this helps, copy the data to a new sheet and rebuild the formula there—this rules out corrupted formatting.
Frequently Asked Questions
Why does SUBTOTAL ignore my filtered rows?
It should not if you used 101–111. If it does, you probably used 1–11, which includes filtered rows. Change the first number to its 100-series equivalent.
Can SUBTOTAL add up cells that contain errors?
No. SUBTOTAL returns an error if any cell in the range has an error. Use AGGREGATE with the option to ignore errors, or clean the error cells first.
Does SUBTOTAL work with conditional formatting or merged cells?
Merged cells can cause the range to behave unexpectedly because only the top-left cell holds the value. Unmerge before using SUBTOTAL. Conditional formatting does not affect the calculation.
Why is my SUBTOTAL different from the status bar sum?
The status bar sums only visible cells. If your SUBTOTAL uses 1–11, it includes manually hidden rows, so the two will differ. Switch to 101–111 to match.
Can I use SUBTOTAL across multiple worksheets?
Not directly in one range. You can place a SUBTOTAL on each sheet and then sum those results on a summary sheet.