Formula Errors

Fix Excel COUNTIFS Ranges That Do Not Expand After Data Refresh

Olivia MillerOlivia Miller Nov 22, 2026 869 views

Question details

Make Excel COUNTIFS criteria ranges remain the same size when external data is refreshed.

Fix Excel COUNTIFS Ranges That Do Not Expand After Data Refresh
Product
Microsoft Excel
Device & OS
not provided
Scenario
A COUNTIFS formula counts rows in an external data range that can grow after a refresh.
Observed behavior
One criteria range expands after refresh while another stays fixed, causing a #VALUE! error.
Before you start

Check which columns contain each criterion and confirm that the values to be compared appear on the same rows. Select the COUNTIFS formula and compare the size of each criteria range.

Solution 1Recommended

Use Excel Table references for automatically expanding ranges

Use structured references when the refreshed data is loaded into an Excel Table.

1
Check the data table

Click a cell in the refreshed data. If it is not already an Excel Table, select the data and choose Insert > Table, then confirm the header setting.

2
Identify the table and columns

Select the table and open Table Design to find its name. Note the column headers corresponding to the two criteria.

3
Update the formula

In the formula cell, use references to columns in the same table, such as =COUNTIFS(Table1[Status],"TestPass",Table1[Flag],"yes"). Replace the table name and headers with your own.

4
Refresh and verify

Choose Data > Refresh All, then check that the new rows appear inside the table and that the COUNTIFS result updates without an error.

Use Excel Table references for automatically expanding ranges
Keep the data in one table: Structured references expand with the table, but the refresh must load new rows into that table. Check the connection or query settings if refreshed rows appear elsewhere.
Work with formulas in WPS

Use matching COUNTIFS ranges in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and use matching whole-column references to count rows without a range-size mismatch.

  1. 1. Open the workbook: In WPS Spreadsheets, choose Open and select your Excel workbook.
  2. 2. Locate the criteria columns: Check the column letters containing the values you want COUNTIFS to compare on each row.
  3. 3. Enter matching ranges: Select the result cell and enter =COUNTIFS(F:F,"TestPass",A:A,"yes"), replacing the columns and criteria as needed.
  4. 4. Check the result: Press Enter and confirm that the formula returns a count rather than a range-size error.
Use COUNTIFS with matching criteria rangesOpen and edit Microsoft Excel XLSX filesWork with a familiar spreadsheet interfaceUse WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Why does COUNTIFS return #VALUE! after a refresh?

COUNTIFS requires all criteria ranges to have the same dimensions. If a refresh expands one range but not another, edit the formula so the ranges cover matching rows and columns.

Do Excel Table references expand when new data is refreshed?

Structured references expand when new rows are added to the referenced table. Make sure the data connection or query loads refreshed rows into that table, then use references such as Table1[Status].

Can I mix a whole-column reference with a fixed range?

No. A formula such as COUNTIFS(F:F,"TestPass",A2:A100,"yes") uses ranges of different sizes and can return #VALUE!. Use matching whole columns or equally sized ranges.

Will whole-column references count data outside the refreshed range?

They can. References such as F:F and A:A include the entire columns, so matching values elsewhere in those columns may also be counted. Use table references to limit the formula to the table's data.