logo
search
Formula Errors

How to Fix COUNTIFS #VALUE! Error in Excel

Emma BrownEmma Brown Oct 16, 2026 869 views

Question details

The user is encountering a #VALUE! error when attempting to use the COUNTIFS function with multiple criteria ranges.

How to Fix COUNTIFS #VALUE! Error in Excel
Product
Excel
Device & OS
not provided
Scenario
Setting up a COUNTIFS formula to count cells based on multiple criteria, but one or more of the selected ranges differ in size.
Observed behavior
The formula fails to calculate the count and instead returns a #VALUE! error due to mismatched dimensions in the criteria ranges.
Before you start

Click on the cell containing the error and review your formula carefully to note the exact starting and ending row and column numbers for each range you have selected.

Solution 1Recommended

Ensure All Criteria Ranges Have Identical Dimensions

The COUNTIFS function strictly requires every criteria range to have the exact same number of rows and columns. Mismatched shapes are the most common cause of the #VALUE! error.

If you use a multi-column range for your first criteria (e.g., J7:BR81) and a single-column range for your second criteria (e.g., CB7:CB81), Excel cannot align the data properly to evaluate it.

1
Select the formula cell

Click on the cell displaying the #VALUE! error to make the formula visible in the Formula Bar at the top of the screen.

2
Identify mismatched ranges

Check the row and column references for each criteria range. For example, if your first range spans from row 7 to 81 (75 rows) in a single column, every other range must also span exactly 75 rows in a single column.

3
Adjust range sizes

Modify the incorrect references so they all match in dimension. Change any multi-column or incorrectly sized ranges to perfectly mirror the shape of your primary criteria range.

4
Apply the changes

Press Enter to apply the updated formula. The #VALUE! error should disappear and display the correct calculated count.

Ensure All Criteria Ranges Have Identical Dimensions
Visual Check: When you click inside the Formula Bar, Excel color-codes and outlines your ranges. You can quickly see if one outlined box is larger or wider than the others.
Efficient Formula Troubleshooting

Easily Calculate and Troubleshoot Formulas with WPS Spreadsheet

WPS Spreadsheet fully supports COUNTIFS and provides intuitive, color-coded error-checking tools to help you quickly spot mismatched ranges and fix formula errors effortlessly.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing the #VALUE! error.
  2. 2. Examine the ranges: Double-click the cell with the error. WPS Spreadsheet will automatically highlight all referenced ranges in different colors.
  3. 3. Resize visually: Hover over the corners of the highlighted range boxes and drag them so that all boxes cover the exact same number of rows and columns.
  4. 4. Confirm the formula: Press Enter. WPS Spreadsheet will instantly recalculate the formula and provide the correct result.
100% compatible with Microsoft Excel formulas, functions, and file formats (.xlsx).Built-in visual error checking highlights mismatched formula ranges instantly.Lightweight and fast, handling complex calculations and large datasets with ease.Free to use with a familiar, user-friendly interface that requires no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Can COUNTIFS criteria ranges be different sizes if the criteria themselves are different?

No. Regardless of what criteria you are evaluating, every single criteria range within a COUNTIFS function must have the exact same number of rows and columns. If they do not match perfectly, the function will always return a #VALUE! error.

Does COUNTIFS work with ranges located on different worksheets?

Yes, COUNTIFS can reference criteria ranges on different worksheets or even entirely different workbooks. However, the core rule remains the same: the dimensions (number of rows and columns) of those referenced ranges must be identical.

What if I get a #VALUE! error but my ranges are the exact same size?

If your dimensions match perfectly, the error might be caused by referencing a closed external workbook. The COUNTIFS function requires any linked external workbooks to be open to calculate properly; if they are closed, a #VALUE! error will occur. It can also happen if your criteria string exceeds 255 characters.