ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dynamic arrays
  3. Sum, Count or Average FILTER Results in Excel

Sum, Count or Average FILTER Results in Excel

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

To sum FILTER results in Excel, put FILTER inside SUM: =SUM(FILTER(D2:D9,B2:B9="East")) adds the sales of East rows only. Swap SUM for COUNT, AVERAGE or MAX for other answers. Add 0 as FILTER's third argument so no matches return 0 instead of #CALC!. To total rows left visible by the filter buttons, use =SUBTOTAL(109,D2:D9).

Key takeaways

  • Filter only the column you want to add, then wrap it: =SUM(FILTER(sales,test)).
  • Give FILTER an if_empty value of 0 so the sum shows 0 when nothing matches.
  • Multiply tests for AND and add them for OR; this is where FILTER beats SUMIFS.
  • To total a spilled FILTER result already on the sheet, use its spill reference, like =SUM(F2#).
  • For rows hidden with the filter buttons, use SUBTOTAL(109,range), not SUM.
On this page+
  1. How to sum FILTER results with one formula
  2. Count, average, max and min of FILTER results
  3. What happens when nothing matches?
  4. Sum with AND, OR and other tests
  5. How to total a FILTER result already on the sheet
  6. How to sum rows filtered with the filter buttons
  7. SUM with FILTER or SUMIFS?
  8. Practise it

To sum FILTER results in Excel, wrap the FILTER formula in SUM: FILTER picks the matching values and SUM adds them up. The same idea works with COUNT, AVERAGE, MAX and MIN. This guide shows each one on a small sales table, how to avoid errors when nothing matches, and how to total rows you filtered with the filter buttons instead.

How to sum FILTER results with one formula#

Filter the column you want to add, then put SUM around it. The pattern is:

Excel formula
=SUM(FILTER(column_to_add, test))

FILTER needs Excel 2021, Excel 2024 or Microsoft 365. Inside SUM, the results don't spill: SUM receives the whole list and returns one number. The FILTER function guide and the SUM function guide cover each function on its own.

All the examples use this table in A1:D9:

ABCD
1RepRegionProductSales
2AnaEastLaptop1200
3BenWestPhone800
4CaraEastPhone650
5DevSouthLaptop1500
6EliEastTablet900
7FemiWestLaptop1100
8GusSouthPhone700
9HanaEastLaptop1300

To add the East sales:

Excel formula
=SUM(FILTER(D2:D9,B2:B9="East"))

FILTER returns 1200, 650, 900 and 1300. SUM adds them: 4,050. Notice the first argument is only the Sales column, D2:D9. If you filter the whole table A2:D9, SUM still works, but it's harder to read and easy to get wrong.

Count, average, max and min of FILTER results#

Swap SUM for another function to answer a different question about the same rows:

QuestionFormulaResult
How many East sales?=COUNT(FILTER(D2:D9,B2:B9="East"))4
Average East sale=AVERAGE(FILTER(D2:D9,B2:B9="East"))1012.5
Biggest East sale=MAX(FILTER(D2:D9,B2:B9="East"))1300
Smallest East sale=MIN(FILTER(D2:D9,B2:B9="East"))650
Number of rows returned=ROWS(FILTER(A2:D9,B2:B9="East"))4

COUNT counts numbers, so use it on a number column like Sales. ROWS counts the rows FILTER returns from any range. Both are reliable when at least one row matches. The next section explains what happens when none do.

What happens when nothing matches?#

When no row passes the test, FILTER returns a #CALC! error, and SUM passes that error on. Try =SUM(FILTER(D2:D9,B2:B9="North")): there is no North region, so the cell shows #CALC!.

Fix it with FILTER's third argument, if_empty. For a sum, use 0:

Excel formula
=SUM(FILTER(D2:D9,B2:B9="North",0))

The result is 0. For counts, use an empty text "" with COUNT, which ignores text: =COUNT(FILTER(D2:D9,B2:B9="North","")) returns 0. Don't use ROWS or COUNTA here: they count the one cell holding the message or error and return 1. For an average, wrap the formula in IFERROR, because the average of nothing is a #DIV/0! error.

Sum with AND, OR and other tests#

FILTER's test can be any formula that returns TRUE or FALSE for each row, so it handles conditions that are hard with SUMIFS.

AND: multiply the tests. East laptops:

Excel formula
=SUM(FILTER(D2:D9,(B2:B9="East")*(C2:C9="Laptop")))

That returns 1200 + 1300 = 2,500.

OR: add the tests. East or West:

Excel formula
=SUM(FILTER(D2:D9,(B2:B9="East")+(B2:B9="West")))

That returns 4,050 + 800 + 1,100 = 5,950. With SUMIFS you'd need two SUMIFS added together.

Tests with functions: FILTER can use MONTH, YEAR, LEFT or SEARCH on the column. For example, ISNUMBER(SEARCH("lap",C2:C9)) matches any product containing "lap". The guides to FILTER with multiple criteria, FILTER by date and FILTER for text that contains a word show many more tests you can sum.

How to total a FILTER result already on the sheet#

If a FILTER formula already spills a table on the sheet, refer to its result with the spill range operator #. Say F2 holds =FILTER(D2:D9,B2:B9="East"). Then:

Excel formula
=SUM(F2#)

returns 4,050, and it stays right when the filtered list grows or shrinks. If the spill has several columns, pick one with INDEX. With =FILTER(A2:D9,B2:B9="East") in F2, =SUM(INDEX(F2#,,4)) adds the fourth column, Sales.

Show the matching rows and their total together#

A filtered list changes length, so a total typed under it can end up in the way of the spill. Put the total above the list instead. With the region to show in F1:

  1. In F3, type =FILTER(A2:D9,B2:B9=F1,"No sales") to list the matching rows.
  2. In I1, type =SUM(FILTER(D2:D9,B2:B9=F1,0)) for their total.

Type East in F1, and the list shows four rows with 4,050 above it. Type West, and it shrinks to two rows with 1,900. Nothing ever sits below the spill, so you never get a #SPILL! error, and a reader sees the detail and the answer at once.

How to sum rows filtered with the filter buttons#

If you filtered the table with the filter buttons (Data > Filter, or Ctrl+Shift+L; Mac: ⌘⇧F), SUM still adds every row, hidden or not. Use SUBTOTAL instead:

Excel formula
=SUBTOTAL(109,D2:D9)

The 109 means "SUM, ignoring hidden rows". Filter the Region column to East, and the formula shows 4,050. Clear the filter, and it shows the full total of 8,150. Use 103 to count visible non-empty cells and 101 for the average.

AGGREGATE does the same job with more options, such as ignoring errors: =AGGREGATE(9,5,D2:D9) sums visible rows. The SUM function article explains why a plain SUM sometimes gives a total you didn't expect.

SUM with FILTER or SUMIFS?#

For one or two simple conditions, =SUMIFS(D2:D9,B2:B9,"East") gives the same 4,050, works in every version and is shorter. Choose SUM with FILTER when you need OR logic, a test built with another function, or when you want to show the matching rows and their total side by side.

Practise it#

Totalling the rows that match a condition is one of the most common tasks in Excel tests. Practise FILTER in a live spreadsheet: you type the formula and it checks it instantly. Then practise SUM and AutoSum to get fast at totals. Start with the exercise on this page: one formula for East laptop sales.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

What are the total sales of laptops in the East? In G2, wrap FILTER in SUM: filter D2:D9 where the region in B2:B9 is East and the product in C2:C9 is Laptop.

fx
ABCDEFGH
1
Rep
Region
Product
Sales
2
Ana
East
Laptop
1200
East laptops
3
Ben
West
Phone
800
4
Cara
East
Phone
650
5
Dev
South
Laptop
1500
6
Eli
East
Tablet
900
7
Femi
West
Laptop
1100
8
Gus
South
Phone
700
9
Hana
East
Laptop
1300
10
11
12

Tip: Inside FILTER: the Sales column, then (B2:B9="East")*(C2:C9="Laptop"). Wrap the whole thing in SUM.

Practise this in a lesson

LessonFILTER: pull matching rows with a formulaReturn every row that meets one or more conditions with FILTER, and show a friendly message when nothing matches.LessonSUM and AutoSumAdd up a column of numbers with SUM, then let AutoSum write the formula for you.Function guideFILTERReturn every row that matches a condition with Excel's FILTER. Multiple criteria, empty results and #SPILL! explained, with live practice.Function guideSUMAdd up columns, rows and separate ranges with Excel's SUM function. Clear examples, common mistakes and a live practice exercise.

Frequently asked questions

How do I sum filtered data in Excel?

+

If you used the filter buttons, use =SUBTOTAL(109,D2:D9), which adds only the visible rows. If you want a formula that filters by itself, use =SUM(FILTER(D2:D9,B2:B9="East")).

Can you use SUM with FILTER in Excel?

+

Yes. FILTER returns the matching values and SUM adds them, for example =SUM(FILTER(D2:D9,C2:C9="Laptop")). It works in Excel 2021, Excel 2024 and Microsoft 365.

How do I count the results of a FILTER formula?

+

Use =COUNT(FILTER(D2:D9,B2:B9="East","")) on a number column, or ROWS for the number of rows returned. Be careful: ROWS and COUNTA return 1 when FILTER finds nothing, because the message or error still fills one cell.

Why does SUM(FILTER()) return #CALC!?

+

No rows matched the test, so FILTER returned an empty-array error. Add 0 as the third argument: =SUM(FILTER(D2:D9,B2:B9="North",0)).

Should I use SUMIFS or SUM with FILTER?

+

Use SUMIFS for simple AND conditions on columns; it is shorter and works in every version. Use SUM with FILTER for OR logic, tests built with functions like MONTH or SEARCH, or when you also want to see the matching rows.

Sources

  • FILTER function - Microsoft Support
  • SUM function - Microsoft Support
  • SUBTOTAL function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How to sum FILTER results with one formula
  2. Count, average, max and min of FILTER results
  3. What happens when nothing matches?
  4. Sum with AND, OR and other tests
  5. How to total a FILTER result already on the sheet
  6. How to sum rows filtered with the filter buttons
  7. SUM with FILTER or SUMIFS?
  8. Practise it

Keep reading

Dynamic arrays· 6 min read

The FILTER Function in Excel (With AND and OR)

FILTER returns every row of a range that passes a test: =FILTER(A2:C9,B2:B9="East"). The matching rows spill into the cells below and update when the data changes. For AND, multiply tests in brackets; for OR, add them. The third argument shows a message when nothing matches. FILTER needs Excel 2021, Excel 2024 or Microsoft 365.

Dynamic arrays· 6 min read

FILTER by Date in Excel: Month, Range or Recent

To filter by date in Excel with a formula, give FILTER two date tests multiplied together. For March 2024: =FILTER(A2:C9,(A2:A9>=DATE(2024,3,1))*(A2:A9<=DATE(2024,3,31))). Put the start and end dates in cells to change the range without editing the formula. For recent rows, use A2:A9>=TODAY()-30. FILTER needs Excel 2021, Excel 2024 or Microsoft 365.

Dynamic arrays· 6 min read

FILTER Rows That Contain Text in Excel

To filter rows that contain text in Excel, combine FILTER with ISNUMBER and SEARCH: =FILTER(A2:C8,ISNUMBER(SEARCH("desk",A2:A8))). SEARCH returns a position where the text is found and an error where it isn't, and ISNUMBER turns that into TRUE or FALSE for each row. Use FIND instead of SEARCH for a case-sensitive match. FILTER needs Excel 2021 or Microsoft 365.

More on dynamic arrays

  • FILTER With Multiple Criteria: AND and OR
  • The SEQUENCE Function in Excel
  • Make a List of Dates With SEQUENCE in Excel
  • Sort by Multiple Columns in Excel (Formula and Menu)
  • SORT and SORTBY in Excel
  • #SPILL! Error in Excel: What It Means and How to Fix It
All dynamic arrays articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free