logo
search
Formula Errors

How to Fix COUNTIFS #VALUE! Error When Counting Nonblank Cells

Ayan MasoodAyan Masood Oct 22, 2026 869 views

Question details

The user encounters a #VALUE! error when using the COUNTIFS function with an asterisk to count nonblank cells.

How to Fix the COUNTIFS #VALUE! Error When Counting Nonblank Cells
Product
Spreadsheet
Device & OS
not provided
Scenario
Using the COUNTIFS formula with multiple criteria ranges, including a wildcard (*) for nonblank entries.
Observed behavior
The formula returns a #VALUE! error instead of the expected cell count.
Before you start

Double-check the cell references in your COUNTIFS formula to identify all the criteria ranges you are currently using.

Solution 1Recommended

Make All Criteria Ranges the Same Size

The COUNTIFS function requires all criteria ranges to have the exact same number of rows and columns. Mismatched ranges will trigger a #VALUE! error.

A common mistake when building multi-criteria formulas is combining an entire-column reference (like A:A) with a specifically defined range (like H2:H200). Because these two ranges have a different number of rows, the spreadsheet software cannot match the criteria row by row, resulting in a #VALUE! error.

1
Inspect the formula

Click on the cell displaying the #VALUE! error to view the formula in the Formula Bar.

2
Identify mismatched ranges

Look at the range arguments you have entered. For example, if you see =COUNTIFS('Project1'!A:A, "Jan", 'Project1'!H2:H200, "*"), the ranges A:A and H2:H200 do not match.

3
Adjust the cell references

Modify the shorter or longer range so they span the exact same number of rows. Change A:A to A2:A200 to match the second range.

4
Apply the fix

Press Enter to save the updated formula, such as =COUNTIFS('Project1'!A2:A200, "Jan", 'Project1'!H2:H200, "*"). The correct count should now appear.

Make All Criteria Ranges the Same Size
Using Entire Columns: You can use entire columns in COUNTIFS, but you must ensure every range uses them. For example, =COUNTIFS(A:A, "Jan", H:H, "*") is perfectly valid.
Advanced Spreadsheet Tool

Use WPS Spreadsheet for Accurate Formula Calculations

WPS Spreadsheet provides comprehensive formula support, including COUNTIFS, with built-in argument wizards to help you easily align range sizes and avoid common syntax errors.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your data.
  2. 2. Insert the function: Select a blank cell, go to the 'Formulas' tab, and click 'Insert Function'.
  3. 3. Use the formula wizard: Search for COUNTIFS. The function dialog box will provide separate input fields for each Criteria_Range, making it easier to ensure they are visually identical in size.
Fully compatible with Microsoft Excel formulas, functions, and file formats.Real-time syntax guides and error-checking tools.Free, lightweight, and fast processing for large datasets.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the asterisk (*) work for counting nonblank cells?

The asterisk is a wildcard character that represents any sequence of text characters. When used as criteria in COUNTIFS, it effectively counts any cell containing text strings, bypassing empty cells.

Can I count nonblank cells containing numbers using an asterisk?

No, the asterisk wildcard only works for text values. To count cells containing numbers, dates, or any nonblank value, it is better to use the criteria "<>" instead of "*".

Does COUNTIFS treat formulas returning empty strings ("") as blank?

If a formula returns an empty string (""), the cell is not technically blank to some functions. However, using the "*" wildcard criteria will typically skip these empty strings, making it a popular workaround for visually blank cells.