The FILTER function has no built-in "not zero" switch, so the working answer is to add a criteria argument that tests the range against zero. For a single column of numbers in A2:A100 and matching labels in B2:B100, use =FILTER(A2:B100, A2:A100<>0). The <>0 part means "not equal to zero," and FILTER returns only the rows where that test is TRUE. Everything below explains how to build that formula safely, how to handle blanks and text, and what to do when it returns an error.
What You'll Need
- Microsoft 365, Excel 2021, or Excel for the web — FILTER and its companion dynamic array functions do not exist in Excel 2019 or earlier, and there is no workaround formula that behaves identically.
- A data range with a header row kept separate from the data, so the criteria refer only to actual values.
- An empty block of cells below and to the right of your formula, because FILTER spills its results and a
#SPILL!error appears if anything is in the way. - Optional but useful: a small helper cell (say E1) holding the value you want to exclude, so you can change it without editing the formula.
Step-by-Step
- Identify the column that can contain zeros. Suppose quantities sit in C2:C200 and product names in B2:B200. You will filter on column C but return columns B and C together.
- Write the basic not-zero formula. Click an empty cell and type
=FILTER(B2:C200, C2:C200<>0). Press Enter. Every row whose quantity is not zero spills downward, headers excluded. - Check the range sizes match. The return range (B2:C200) and the criteria range (C2:C200) must have the same number of rows. If they do not, Excel returns
#VALUE!. A quick way to guarantee alignment is to write the criteria against the first column of the return range or to use whole-column references carefully, such as=FILTER(B:C, C:C<>0)— though whole-column versions are slower on large sheets. - Add a second condition with multiplication. To exclude zeros and blanks in one pass, multiply two tests:
=FILTER(B2:C200, (C2:C200<>0)*(C2:C200<>"")). In array logic,*means AND and+means OR. Parentheses around each test are required. - Handle text in the same column. If the column mixes numbers and text,
<>0already keeps the text rows because text is not equal to zero. If you want numbers only, use=FILTER(B2:C200, ISNUMBER(C2:C200)*(C2:C200<>0)). - Give FILTER something to show when everything is zero. Wrap it:
=FILTER(B2:C200, C2:C200<>0, "No non-zero rows"). The third argument is the if-empty value and prevents the#CALC!error. - Sort the output if you need order. FILTER preserves source order. To sort the result, nest it inside SORT:
=SORT(FILTER(B2:C200, C2:C200<>0), 2, 1)sorts by the second column of the result, ascending. - Test with a deliberate change. Type a zero into one of the included rows and watch that row disappear from the spill. Type a non-zero value into an excluded row and watch it appear. This confirms the criteria range points where you think it does.
Common Mistakes
- Using
!=0instead of<>0. Excel uses<>for "not equal." The exclamation-mark version is a programming convention and returns an error or wrong result. - Mismatched range heights.
=FILTER(B2:C200, C2:C100<>0)fails because 199 rows are returned but only 99 are tested. - Forgetting the parentheses in multi-condition formulas.
C2:C200<>0*C2:C200<>""is read as a single comparison and produces nonsense. Each test needs its own brackets. - Blocking the spill. If any cell in the area FILTER wants to fill already contains something — even a space — you get
#SPILL!. Clear the block or move the formula. - Including the header row in the criteria range. A text header compared to zero is TRUE, so the header leaks into the results. Start ranges at row 2.
- Expecting FILTER in Excel 2019 or older. It is not there. Use AutoFilter with a number filter of "does not equal 0" as the manual alternative.
Tips
- Store the exclusion value in a cell and reference it:
=FILTER(B2:C200, C2:C200<>$E$1). Change E1 to 5 and the formula now excludes fives instead of zeros. - Combine with
COUNTAorROWSto count results without hard-coding:=ROWS(FILTER(B2:C200, C2:C200<>0)). - Convert the source range to an Excel Table (Ctrl+T on Windows, Command+T on Mac) and use structured references like
Table1[Qty]. The formula then grows automatically as rows are added. - Remember that FILTER treats an empty cell as zero in numeric comparisons. If blanks are sneaking through, add the
<>""test described in step 4. - Use
LETto keep long formulas readable:=LET(data, B2:C200, qty, C2:C200, FILTER(data, qty<>0, "None")).
Troubleshooting
You see #CALC!. No rows met the criteria — every value was zero. Add the third if-empty argument so the formula shows a message instead of an error.
You see #VALUE!. The return range and criteria range are different sizes. Recount the rows in both.
You see #SPILL!. Something occupies the cells below the formula. Select the whole spill area, delete the contents, and the formula recalculates. Merged cells in the target area also cause this and must be unmerged.
You see #NAME?. The function name is misspelled, or your Excel version does not support FILTER. Check with =ISFORMULA on a known dynamic array formula, or simply confirm your version under File > Account.
Zeros still appear. The criteria range is probably offset by a row — for example, returning from row 2 but testing from row 3. Both ranges must start on the same row. Also check the cell format: a value stored as text "0" is not equal to the number 0, so convert the column with Text to Columns or VALUE.
Results are stale. Press F9 to force a recalculation, or check that calculation is set to Automatic under Formulas > Calculation Options.
Frequently Asked Questions
Can FILTER exclude zeros in more than one column at once?
Yes. Multiply the tests: =FILTER(A2:D200, (B2:B200<>0)*(C2:C200<>0)) keeps only rows where both columns are non-zero.
Does <>0 also remove negative numbers?
No. It removes exactly zero. Negative values pass through because they are not equal to zero. To keep only positives, use >0 instead.
Why does my FILTER formula return blanks as well as zeros?
Excel compares an empty cell to zero as TRUE in some contexts, so blanks can slip past <>0. Add *(C2:C200<>"") to the criteria to remove them.
Can I use FILTER to exclude zero on a Mac?
Yes, provided you are on Excel for Microsoft 365 or Excel 2021 for Mac. The syntax is identical; only the keyboard shortcuts for entering array formulas differ, and dynamic arrays do not need Ctrl+Shift+Enter.
What is the alternative if my Excel version lacks FILTER?
Use AutoFilter: select the header, apply Data > Filter, open the number filter on the relevant column, and choose "Does not equal" with 0 entered. It is manual but works in every version.
Can FILTER reference a different sheet?
Yes, as long as both ranges come from the same sheet reference pattern: =FILTER(Sheet2!B2:C200, Sheet2!C2:C200<>0). Keep the sheet name on both ranges.