Formula Errors

Make Excel FILTER and ROWS Return Blank Instead of 1

Elise WilliamsElise Williams Nov 18, 2026 869 views

Question details

Return a blank result when an Excel FILTER formula finds no matching records instead of counting the no-match message as one row.

Make Excel FILTER and ROWS Return Blank Instead of 1
Product
Microsoft Excel
Device & OS
not provided
Scenario
A formula filters a table by origin, year, and nonblank items, then counts unique results with ROWS.
Observed behavior
FILTER returns the text "No data" when there are no matches, and ROWS counts that text as one row.
Before you start

Check that your Excel version supports FILTER, UNIQUE, and LET. Confirm that the TRegistos table has Item, Origem, and Data columns, and that Data contains valid Excel dates.

Solution 1Recommended

Check the FILTER result before counting unique items

Use this formula to return a blank for an empty input or no matches and count unique items otherwise.

FILTER's empty-string fallback is still a one-row result, so ROWS alone would return 1. The formula checks for that fallback before counting.

1
Select the result cell

In Excel, click the cell containing the existing FILTER and ROWS formula.

2
Replace the formula

In the formula bar, enter: =IF(OR($C$8="No data",$C$8=""),"",LET(result,FILTER(TRegistos[Item],(TRegistos[Origem]=$C$8)*(YEAR(TRegistos[Data])=$G$2)*(TRegistos[Item]<>"")*(TRegistos[Item]<>0),""),IF(AND(ROWS(result)=1,INDEX(result,1,1)=""),"",ROWS(UNIQUE(result)))))

3
Test both outcomes

Press Enter, then change C8 or G2 to test a matching and a nonmatching selection. The cell should be blank when no records match.

Check the FILTER result before counting unique items
Adjust references if needed: Replace the table, column, and cell references with those in your workbook. This check works because the filter excludes blank Item values.
Work with spreadsheets in WPS Office

Check filtered results in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and use the same empty-result check to avoid counting a no-match fallback. Your WPS version must support the formula functions and table references used.

  1. 1. Open the workbook: In WPS Office, open WPS Spreadsheets and select Open to choose your Excel workbook.
  2. 2. Check formula support: Select an empty cell and test FILTER, UNIQUE, and LET with your data. Also check that your version recognizes the workbook's structured table references.
  3. 3. Enter the formula: Select the result cell and enter the recommended FILTER and ROWS formula in the formula bar, adjusting its references to match your workbook.
  4. 4. Test and save: Test matching and nonmatching criteria, then select Save to retain the changes in your XLSX file.
Check filtered results before counting unique itemsOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceWork with spreadsheets in a free office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does ROWS return 1 when FILTER finds no matches?

FILTER returns its if_empty value as a single result. If that value is "No data" or an empty string, ROWS still sees one row unless you check for the fallback first.

Will an empty string in FILTER automatically make ROWS return blank?

No. Use FILTER's empty-string fallback and test it before applying ROWS, as in the recommended LET formula.

What happens if C8 is blank or contains "No data"?

The outer IF checks C8 first and returns an empty string without counting filtered results.

Can I use the formula if my Item column contains text?

The unique-count formula can count text items. The SUM version is for numeric values; SUM does not add text items.