Excel SUBTOTAL Function
Chala mitrano — today SUBTOTAL. Totals that respect AutoFilter — function 9 is SUM; use 109 to ignore hidden rows too.
चला मित्रांनो — आज SUBTOTAL. AutoFilter मानणारे totals — 9 = SUM; visible-only साठी 109.
चलो दोस्तों — आज SUBTOTAL. AutoFilter मानने वाले totals — 9 = SUM; सिर्फ़ दिखती पंक्तियों के लिए 109।
Purpose
Run a stats function (SUM, COUNT, AVERAGE, …) on a range, with options that respect filters.
Return value
The subtotal result for the chosen function_num.
Syntax
Arguments
| Argument | Required? | Description |
|---|---|---|
function_num | Required | Code for the job: 1 AVERAGE, 2 COUNT, 3 COUNTA, 9 SUM, …; 101+ ignore hidden rows. |
ref1 | Required | Range to aggregate. |
ref2,… | Optional | More ranges. |
Version
Excel 2003+. LibreOffice Calc too.
How to use — Why → What → How
Why: Filtered sheets still show a correct total. SUBTOTAL is the classic filter-friendly total. Filtered sales in Ahmedabad showrooms and Boston outlets. Mixed ₹ and $. In Indian back offices and foreign sister teams, SUBTOTAL shows up on totals, rates and pack sheets every week.
What: SUBTOTAL applies a built-in function coded by function_num. Codes 1–11 include manually hidden rows; 101–111 ignore hidden rows. Filtered-out rows are skipped for both families in normal AutoFilter use. Read every argument in the table once before you type; each one changes the answer on purpose.
How — numbered steps:
- Type =SUBTOTAL(9,B2:B100) for SUM.
- Prefer 109 when you hide rows manually too.
- Do not nest SUBTOTAL ranges carelessly — Excel skips other SUBTOTAL cells.
Ravindra Bagale's Tip
Friends, after SUBTOTAL, find one column or range in a real workbook this week where this lesson saves time.
Ravindra Bagale's Tip – मराठी
मित्रांनो, SUBTOTAL नंतर या आठवड्यात खरी workbook मधील एक संख्या column सुधारा.
Ravindra Bagale's Tip – हिंदी
दोस्तों, SUBTOTAL के बाद इस हफ़्ते असली workbook का एक संख्या column सुधारो.
Ravindra Bagale's Tip
Friends, sleep on SUBTOTAL; rebuild example 1 tomorrow without looking.
Ravindra Bagale's Tip – मराठी
मित्रांनो, SUBTOTAL वर झोपा; उद्या उदाहरण 1 न पाहता लिहा.
Ravindra Bagale's Tip – हिंदी
दोस्तों, SUBTOTAL पर सोकर कल उदाहरण 1 बिना देखे लिखो.
Ravindra Bagale's Tip
Friends, say the business question in plain words before =SUBTOTAL.
Ravindra Bagale's Tip – मराठी
मित्रांनो, =SUBTOTAL आधी व्यवसाय प्रश्न साध्या शब्दांत सांगा.
Ravindra Bagale's Tip – हिंदी
दोस्तों, =SUBTOTAL से पहले व्यवसाय प्रश्न सादे शब्दों में बोलो.
Ravindra Bagale's Tip
Friends, check a known case with a calculator before you trust a long SUBTOTAL chain.
Ravindra Bagale's Tip – मराठी
मित्रांनो, लांब SUBTOTAL chain वर विश्वास ठेवण्यापूर्वी कॅल्क्युलेटरने एक ज्ञात case तपासा.
Ravindra Bagale's Tip – हिंदी
दोस्तों, लंबी SUBTOTAL chain पर भरोसा करने से पहले कैलकुलेटर से एक जाना हुआ case जाँचो.
Ravindra Bagale's Tip
Friends, after you finish SUBTOTAL, open yesterday’s real workbook and find one place this function would have saved ten minutes.
Ravindra Bagale's Tip – मराठी
मित्रांनो, SUBTOTAL नंतर कालची खरी वर्कबुक उघडा आणि शोधा जिथे हे फंक्शन दहा मिनिटे वाचवू शकले असते.
Ravindra Bagale's Tip – हिंदी
दोस्तों, SUBTOTAL के बाद कल की असली वर्कबुक खोलो और ढूँढो जहाँ यह फ़ंक्शन दस मिनट बचा सकता था.
Ravindra Bagale's Tip
Friends, treat SUBTOTAL like a seatbelt on number columns — check a known case first.
Ravindra Bagale's Tip – मराठी
मित्रांनो, SUBTOTAL ला संख्या columns वरील seatbelt समजा — आधी ज्ञात case तपासा.
Ravindra Bagale's Tip – हिंदी
दोस्तों, SUBTOTAL को संख्या columns पर seatbelt समझो — पहले जाना हुआ case जाँचो.
Download practice file: practice-subtotal.xlsx (includes sheet About this data, practice sheets, and Answers).
Worked examples
1) SUM code 9
Ahmedabad.
| ₹ |
|---|
| 10 |
| 20 |
| 30 |
Result: 60
What it means: Same as SUM when nothing is filtered.
2) AVERAGE code 1
Mean.
| ₹ |
|---|
| 10 |
| 20 |
| 30 |
Result: 20
What it means: Average of three.
3) COUNT code 2
Numbers only.
| Val |
|---|
| 10 |
| x |
| 30 |
Result: 2
What it means: Two numbers.
4) Boston $
Visible SUM habit.
| $ |
|---|
| 5 |
| 15 |
| 25 |
Result: 45
What it means: 109 = SUM ignoring hidden rows.
5) vs SUM reminder
Filter story.
| City | ₹ |
|---|---|
| Pune | 10 |
| Test | 99 |
| Surat | 20 |
Result: 129
What it means: Without filter equals SUM; with City filter, only visible ₹ add.
6) COUNTA code 3
Non-blanks.
| Name |
|---|
| Asha |
| None |
| Ben |
Result: 2
What it means: Two names.
Common errors and fixes
Notes and tips
- Revisit the SUBTOTAL errors table after the quiz.
- Build example 1 from memory on a blank sheet.
- Check number vs text if a result looks wrong.
- Teach one tip in Marathi or Hindi this week.
- Keep currency symbols consistent inside one report column (practice mixes ₹ $ £ €).
- Drill: filtered City total with SUBTOTAL 9 from memory; also try 109.
- SUBTOTAL vs SUM: filter-aware versus always-all-rows.
- Fictional sample data only — names and amounts are for learning.
- Print the SUBTOTAL revision card for one week of real worksheets.
- Ask juniors to predict before they press Enter.
- Track your top mistake with this function monthly.
- Filtered sales in Ahmedabad showrooms and Boston outlets. Mixed ₹ and $.
- Interview tip: explain the business question before the formula.
- Classroom drill: invent three brand-new formulas from your city without the page open.
- If a result looks wrong, check blanks vs zeros before rewriting.
- When Excel versions differ, note the LibreOffice / Sheets fallback in a cell comment.
- Prefer clear ranges over whole-column refs on huge sheets if speed matters.
- Document units (₹, kg, days) in the header so totals stay honest.
- Print the revision card for SUBTOTAL for one week of real worksheets.
- When helping a junior, ask them to predict before Enter.
- Share one tip with a classmate in Marathi or Hindi.
- Keep currency symbols consistent inside a single report column.
- Interview tip: explain the business question before the formula.
- If a result looks wrong, check blanks vs zeros before rewriting maths.
- When Excel versions differ, write a LibreOffice fallback under a comment.
In real work
Drill: filtered City total with SUBTOTAL 9 from memory; also try 109. Filtered sales in Ahmedabad showrooms and Boston outlets. Mixed ₹ and $. Classroom drill: write three brand-new SUBTOTAL formulas on a blank sheet using names from your own city — if you can invent them without the page open, you own the skill. Then break one formula on purpose and watch the error; recovering from that break is half of interview readiness. Always verify with a known case before trusting a long chain. Keep a personal notebook of the one mistake you make most often with this function; review it monthly.
How it compares
SUBTOTAL vs SUM: filter-aware versus always-all-rows.
Interview corner
- 9 vs 109?
- SUM vs SUM ignore hidden.
- Filter?
- SUBTOTAL skips filtered-out.
- vs AGGREGATE?
- AGGREGATE has more options.
Related functions
AGGREGATE, SUM, AVERAGE, COUNT
Practice tasks (10)
- Task 1. SUBTOTAL 9 SUM.9.
- Task 2. AVERAGE code 1.1.
- Task 3. COUNT code 2.2.
- Task 4. 109 vs 9 explain.Interview.
- Task 5. Filter a city and watch total.Filter.
- Task 6. Fill.Fill.
- Task 7. Doc codes.Note.
- Task 8. Teach.Teach.
- Task 9. COUNTA 3.3.
- Task 10. Bonus AGGREGATE.Related.
Quick quiz
Answers: Q1=SUM, Q2=SUM ignore hidden, Q3=Includes hidden/filtered wrongly for reports, Q4=1, Q5=AGGREGATE (check after you try).
Revision card
Standalone card (no tip or photo strip). QR opens this lesson. Download the PNG and revise offline.