Sheet Clinic

"FILTER has mismatched range sizes": reading the row counts

FILTER shows #N/A and says Expected row count 12, Actual row count 11. One condition starts on a different row. Find it and fix it.

Sheet Clinic editorsPublished
E2=FILTER(A2:A13, B2:B13="East", C3:C13>500)

Before Broken tab

ABCDE
1RepRegionSalesEast, over 500
2EmilyEast620#N/A
3JacobWest480
4OliviaEast350
5MichaelEast910
6SarahSouth705
7DavidEast540

What changed

  1. C3:C13 to C2:C13

After Fixed tab

ABCDE
1RepRegionSalesEast, over 500
2EmilyEast620Emily
3JacobWest480Michael
4OliviaEast350David
5MichaelEast910Chris
6SarahSouth705Ryan
7DavidEast540
Figure 1. Rows 1 to 7 of each tab. One digit in the sales condition separates #N/A from a list of East reps over 500.

A2:A13 holds 12 sales reps, and the FILTER in E2 of the Broken tab is supposed to pick out the ones in the East region with sales over 500. The cell shows #N/A instead. Select it and the red box next to it reads FILTER has mismatched range sizes. Expected row count: 12. column count: 1. Actual row count: 11, column count: 1.

The formula is =FILTER(A2:A13, B2:B13="East", C3:C13>500). The sales condition starts on row 3 while the range starts on row 2. The fix is to give every condition the same start row and the same end row as the range: C2:C13 instead of C3:C13. Do not just push the end down to C3:C14 to make the counts agree. That clears the error, but the rows no longer line up, and FILTER returns a wrong list with no warning (I2 below).

CellRow countsWhat Sheets showed
Broken E2A2:A13 has 12, C3:C13 has 11#N/A, note gives 12 and 11
More mismatches G2A2:A13 has 12, B2:B has 999#N/A, note gives 12 and 999
More mismatches H2A1:A13 has 13, both conditions 12#N/A, note gives 13 and 12
More mismatches I2All 12, but C3:C14 starts on row 3Olivia, Michael, David, Chris, no error
More mismatches J2A2:A, B2:B, C2:C, all start on row 2Emily, Michael, David, Chris, Ryan
Fixed E2All 12, all start on row 2Emily, Michael, David, Chris, Ryan

Read down the Row counts column. In every row where a condition is longer or shorter than the range, Sheets stopped and showed the note. Where the counts agree, it calculated, even in I2, where the references don't line up.

Reading the expected and actual row counts in the note

FILTER takes the range it returns values from first, then one or more conditions. Google's FILTER page says condition arguments must have exactly the same length as the range. In the note, the expected row count is the length of that first argument, A2:A13, which covers rows 2 through 13. The actual row count is the length of the condition that broke the rule. C3:C13 starts one row lower and stops at the same row, so it has 11.

Only the condition that disagrees with the range shows up. B2:B13 matches A2:A13 at 12 rows, and the message says nothing about it.

Both column counts in the note say 1, which is normal for a FILTER that returns one column and tests one column per condition. The row numbers are the ones that disagree here.

Broken tab with E2 selected. The formula bar shows =FILTER(A2:A13, B2:B13="East", C3:C13>500), E2 shows #N/A, and the red note reads: FILTER has mismatched range sizes. Expected row count: 12. column count: 1. Actual row count: 11, column count: 1.
Figure 2. The note gives 12 for the range A2:A13 and 11 for the condition C3:C13.

An open-ended reference and a header row trigger it too

The More mismatches tab starts from the fixed data and adds four versions of the formula in G2, H2, I2 and J2. Row 1 above each one says what changed.

G2 holds =FILTER(A2:A13, B2:B="East", C2:C13>500). The region test has no end row, so it runs to the bottom of the tab while the range stops at row 13. The note reads FILTER has mismatched range sizes. Expected row count: 12. column count: 1. Actual row count: 999, column count: 1.

More mismatches tab with G2 selected. The formula bar shows =FILTER(A2:A13, B2:B="East", C2:C13>500), G2 shows #N/A, and the note reads: FILTER has mismatched range sizes. Expected row count: 12. column count: 1. Actual row count: 999, column count: 1.
Figure 3. 999 is the size of B2:B on this tab, set against 12 for A2:A13.

H2 holds =FILTER(A1:A13, B2:B13="East", C2:C13>500). Here the range picks up the Rep header in A1, which brings its count to 13 while both conditions stay at 12. The note reads FILTER has mismatched range sizes. Expected row count: 13. column count: 1. Actual row count: 12, column count: 1. This time the expected number is the larger one, because the first argument is the reference that is off. The conditions were right all along.

Matching the start row fixes it; stretching the end only silences it

On the Fixed tab, E2 holds =FILTER(A2:A13, B2:B13="East", C2:C13>500). The only change from the Broken tab is C2 instead of C3, and it returns Emily, Michael, David, Chris, Ryan in E2:E6. Those are the East reps over 500 that you find by reading the table yourself. Emily sold 620, Michael 910, David 540, Chris 760 and Ryan 505.

Stretching the bad condition down one row looks like a quicker repair, because it brings the count back to 12. I2 on the More mismatches tab holds =FILTER(A2:A13, B2:B13="East", C3:C14>500), and there's no error. It returned Olivia, Michael, David, Chris.

That list is wrong, and nothing on screen says so. FILTER pairs the first row of each argument, then the second, and so on, so Olivia in row 4 was tested against C5, which is Michael's 910, while her own sales were 350. Michael was tested against Sarah's 705 and David against Ashley's 830. Emily fell out because her row met Jacob's 480, and Ryan fell out because his row met the empty C14. Michael, David and Chris belong in the list, but only by luck of the rows below them, and Olivia does not belong at all.

More mismatches tab with I2 selected. The formula bar shows =FILTER(A2:A13, B2:B13="East", C3:C14>500), I2:I5 lists Olivia, Michael, David and Chris with no error, and J2:J6 lists Emily, Michael, David, Chris and Ryan.
Figure 4. I2 has matching sizes but starts one row low. Its list differs from J2:J6 next to it.

J2 shows the other safe pattern, =FILTER(A2:A, B2:B="East", C2:C>500), with no end rows at all. It returned Emily, Michael, David, Chris, Ryan, the same as the Fixed tab. Open references that all start on row 2 also end on the same last row, so their sizes stay equal however long the tab gets. Mixing the two styles in one formula, as G2 does, is what breaks.

Counting each reference with ROWS

When the references are long or point to another tab, counting by eye gets unreliable. ROWS returns the number of rows in a reference, and empty cells count too, as the 999 for the mostly empty B2:B shows. Column M of the More mismatches tab has four of these checks, with the reference written out in column L:

  • =ROWS(A2:A13) returned 12
  • =ROWS(C3:C13) returned 11
  • =ROWS(B2:B) returned 999
  • =ROWS(A1:A13) returned 13

Each number matches one of the notes above. A ROWS check beside the range and beside each condition finds the pair FILTER will reject. It doesn't catch the I2 case, where every count is 12, so compare the starting rows as well.

Retyping E2 on the Try it yourself tab

The Try it yourself tab is a copy of Broken, with =FILTER(A2:A13, B2:B13="East", C3:C13>500) still in E2. Select E2, replace the formula with =FILTER(A2:A13, B2:B13="East", C2:C13>500) and press Enter. E2:E6 should then show the same five names as the Fixed tab.

InputRep, Region and Sales in A2:C13
Formula=FILTER(A2:A13, B2:B13="East", C2:C13>500)
ExpectedEmily, Michael, David, Chris, Ryan
Sheets returnedEmily, Michael, David, Chris, Ryan Matches expected
Checked2026-11-12, free personal account

The same #N/A also appears when the sizes are fine and no row passes the conditions, which Google's FILTER page lists as a separate case. The red note is what tells them apart, so read it before you change the conditions.

Take-home copy. Four tabs: Broken, Fixed, Try it yourself, More mismatches. It opens as a copy in your own Drive.

Copy the sheet