FILTER Condition Returns #N/A or the Wrong Rows

In Google Sheets, pointing FILTER at a text column returns #N/A, no matches found, not a type error. A number column can keep the wrong rows.

本文目錄

FILTER can spill the Ice 1 bookings you meant, or it can return #N/A with no matches, or keep the wrong rows, depending on what you put in the second argument. In these tests Sheets did not show a parameter-2 type error that says the function expects boolean values; a text condition simply behaved like FALSE.

Enter this fictional municipal ice-rink booking log in A1:E9. Put TRUE and FALSE in D2:D9 as real Boolean values (checkboxes are fine). Keep Minutes and Paid as numbers.

BookingZoneMinutesConfirmedPaid
R-14Ice 160TRUE1
R-15Ice 245FALSE0
R-16Studio30TRUE1
R-17Ice 190TRUE0
R-18Ice 260FALSE1
R-19Studio0FALSE0
R-20Ice 145FALSE1
R-21Ice 230TRUE1

To keep the Ice 1 bookings, enter this in G2:

=FILTER(A2:C9,B2:B9="Ice 1")

The formula spills three rows: R-14, R-17 與 R-20, with their zones and minutes.

In the screenshot, the Ice 1 FILTER spill is in E2:G4: R-14, R-17 and R-20, with their zones and minutes.
Screenshot: Google Sheets, Nov 2026

The Zone column is not a condition

If you point parameter 2 at the Zone column itself:

=FILTER(A2:C9,B2:B9)

Sheets returns #N/A, with the message No matches are found in FILTER evaluation. That is easy to misread as “there are no Ice bookings,” but the column is full of zone names. Those names are text, and in this include array they behave like FALSE, so FILTER keeps no rows.

Google Sheets cell I2 showing #N/A for FILTER pointed at the Zone column, with a hover titled Error that reads No matches are found in FILTER evaluation, and a Fix button.
Screenshot: Google Sheets, Nov 2026

The hover uses a red Error heading and includes a Fix button; I did not click Fix. I did not get a message of the form “Function FILTER parameter 2 expects boolean values” on this text column, on a one-row text condition, or on an IF that returned zone labels. The failure is a quiet no-match, not a type error. Parameter 2 still needs an array of TRUE/FALSE values, one per row of A2:C9. The comparison B2:B9="Ice 1" produces that array: TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE. You can spill those eight values with =ARRAYFORMULA(B2:B9="Ice 1") if you want to inspect them first.

A lone label is a different problem. =FILTER(A2:C9,"Ice 1") returns #N/A with FILTER has mismatched range sizes. Expected row count: 8. column count: 1. Actual row count: 1, column count: 1. The literal is one cell, not eight conditions. That size error is covered in the FILTER mismatched range sizes guide.

Other values in parameter 2

These formulas all use the same booking range. The results below are from Google Sheets; do not assume a text or number column “just works” without checking what comes back.

FormulaResult
=FILTER(A2:C9,C2:C9)Seven rows: every booking except R-19, whose Minutes value is 0. Nonzero numbers are treated as TRUE.
=FILTER(A2:C9,D2:D9)R-14, R-16, R-17 與 R-21. The Confirmed column is already Boolean.
=FILTER(A2:C9,E2:E9)R-14, R-16, R-18, R-20 與 R-21. The Paid flags 1 與 0 follow the same numeric rule as Minutes.
=FILTER(A2:C9,SEARCH("Ice",B2:B9))The six Ice 1 and Ice 2 rows. SEARCH returns a position for those zones; on Studio it returns #VALUE! (In SEARCH evaluation, cannot find 'Ice' within 'Studio'.), and FILTER skipped that row rather than failing the whole formula.
=FILTER(A2:C9,IF(B2:B9="Ice 1","Ice 1","Studio"))#N/A, no matches. The IF returns zone text, which is treated like the raw Zone column.

The text strings TRUE 與 FALSE (as text, not booleans) were coerced and returned the Ice 1 rows. Ordinary labels such as Ice 1 were not. I would not rely on that special-case coercion.

Write the comparison you mean

For a duration cutoff, compare the numbers:

=FILTER(A2:C9,C2:C9>=60)

That returns R-14, R-17 與 R-18. For payments, =FILTER(A2:C9,E2:E9=1) returns the five rows whose Paid value is 1. Both comparisons are easier to read than a bare column of numbers, and they do not depend on 0 happening to be the value you wanted to drop.

For a partial match, wrap SEARCH in ISNUMBER:

=FILTER(A2:C9,ISNUMBER(SEARCH("Ice",B2:B9)))

That also returns the six Ice bookings, and it stays FALSE on Studio instead of leaving a #VALUE! inside the include array. More text-search patterns are in FILTER wildcard and partial matches. If you need a list from a condition rather than a total, FILTER vs QUERY compares those two tools.

Google Sheets FILTER has no if_empty argument. A third argument is another condition, not a fallback message; empty results and Excel #CALC! belong on the CALC error page.

I would type the comparison (B2:B9="Ice 1", C2:C9>=60, or ISNUMBER(SEARCH(...))) and leave the source columns alone. If the include array already looks right in an ARRAYFORMULA helper and FILTER still errors, the next thing to check is range size, not a different zone spelling. \n

Oscar

寫 Excel 與 Google Sheets 的公式和排錯。

Google Sheets, 26 November 2026, new private unshared spreadsheet (locale en_US, 1000-row grid, America/New_York). Formulas were entered as user input through the Sheets API. Error text was read from the Sheets API error message. Sample bookings R-14 through R-21 in A2:E9; D2:D9 were booleans (TYPE 4); C and E were numbers. FILTER(A2:C9,B2:B9="Ice 1") returned R-14, R-17 and R-20. FILTER(A2:C9,B2:B9) returned #N/A, "No matches are found in FILTER evaluation." It did not return a parameter-2 boolean-type message. FILTER(A2:C9,"Ice 1") returned #N/A, "FILTER has mismatched range sizes. Expected row count: 8. column count: 1. Actual row count: 1, column count: 1." FILTER(A2:C9,C2:C9) returned seven rows and omitted R-19 (0 minutes). FILTER(A2:C9,D2:D9) returned R-14, R-16, R-17 and R-21. FILTER(A2:C9,E2:E9) returned R-14, R-16, R-18, R-20 and R-21. FILTER(A2:C9,SEARCH("Ice",B2:B9)) returned the six Ice 1 and Ice 2 rows; SEARCH on Studio was #VALUE!, "In SEARCH evaluation, cannot find 'Ice' within 'Studio'." ISNUMBER(SEARCH("Ice",B2:B9)) returned the same six rows. FILTER with IF returning zone names returned #N/A, no matches. FILTER(A2:C9,C2:C9>=60) returned R-14, R-17 and R-18. FILTER(A2:C9,E2:E9=1) returned the five paid rows. ARRAYFORMULA(B2:B9="Ice 1") was TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE. Text strings TRUE and FALSE in the include array were coerced to booleans and returned the Ice 1 rows. A one-row include of 1 kept the row; 0 returned no matches; a one-row include of DATE(2026,1,1) kept the row; text 1 did not. A scalar 1 against eight rows returned the mismatched-range message. Excel was not run.

本主題下一篇:表格錯誤與動態陣列 How to Calculate APY in Excel and Google Sheets