Function Problems

How to Count Values Greater Than Zero With COUNTIFS in Excel

Huda QurayshiHuda Qurayshi Nov 11, 2026 868 views

Question details

The user needs to count specific rows in a spreadsheet that simultaneously meet multiple conditions, such as matching a specific week number while having a corresponding numerical value greater than zero.

How to Count Values Greater Than Zero With COUNTIFS
Product
Excel
Device & OS
not provided
Scenario
Filtering and counting data records based on conditional logic across multiple columns, specifically requiring values to be strictly positive (>0) alongside another matching criterion.
Observed behavior
The user must apply the COUNTIFS function with appropriate syntax combining multiple criteria ranges and conditions, while ensuring all evaluated ranges share the exact same dimensions.
Before you start

Ensure your dataset does not contain merged cells and verify that all columns or rows you plan to evaluate with your formula contain data of the same length.

Solution 1Recommended

Use the COUNTIFS Function to Evaluate Multiple Conditions

Apply the COUNTIFS function to specify one criterion for an exact match (like a week number) and a second criterion for values greater than zero.

The COUNTIFS function applies criteria to cells across multiple ranges and counts the number of times all criteria are met. When checking for values greater than zero, the condition must be enclosed in double quotation marks as ">0".

1
Select the target cell

Click on the empty cell where you want the final count to be displayed.

2
Start the COUNTIFS formula

Type =COUNTIFS( into the cell or the formula bar to initiate the function.

3
Define the first criteria

Select your first range of data (e.g., a column of week numbers like Sheet1!$R$5:$R$1000), type a comma, and then select or type the criterion you want to match (e.g., cell D24).

4
Define the greater than zero criteria

Type a comma, then select your second range of data where you want to check for positive values (e.g., Sheet1!$O$5:$O$1000). Type another comma, and input ">0" as the criteria.

5
Complete the formula

Close the parenthesis so your formula looks like =COUNTIFS(Sheet1!$R$5:$R$1000, D24, Sheet1!$O$5:$O$1000, ">0") and press Enter to view the result.

Use the COUNTIFS Function to Evaluate Multiple Conditions
Range Size Rule: All ranges used in the COUNTIFS function must have exactly the same number of rows and columns. If they are mismatched, Excel will return a #VALUE! error.
Seamless Spreadsheet Calculations

Use WPS Spreadsheet to Calculate Conditional Data Effortlessly

WPS Spreadsheet fully supports advanced mathematical functions like COUNTIFS, offering seamless compatibility with Microsoft Excel files. You can use the exact same formulas to calculate complex conditional data without altering your workflow.

  1. 1. Open your file in WPS Office: Launch WPS Spreadsheet and open your existing Excel file (.xlsx or .xls).
  2. 2. Select a cell for the result: Click on the cell where you want to display the counted total.
  3. 3. Insert the COUNTIFS formula: Navigate to the Formulas tab and click 'Insert Function', or directly type your formula like =COUNTIFS(A1:A10, "Match", B1:B10, ">0") in the formula bar.
  4. 4. Press Enter to calculate: Hit Enter on your keyboard to instantly calculate and display your counted values.
100% compatible with Microsoft Excel (.xlsx) formats and formulasFamiliar interface with built-in formula suggestions and error checkingFree to use across Windows, Mac, Linux, iOS, and AndroidLightweight and fast, even when calculating large datasets
microsoft office alternative - wps office

Frequently Asked Questions

Why does my COUNTIFS formula return a #VALUE! error?

This error typically occurs when the criteria ranges you selected are not the same size. Ensure both your first range and second range have the exact same number of rows and columns (for example, row 5 to row 1000 for both).

Can I count values greater than zero without adding other conditions?

Yes. If you only need to check one condition (greater than zero), you can use the simpler COUNTIF function instead of COUNTIFS. The formula would look like =COUNTIF(A1:A10, ">0").

How do I reference a cell containing the criteria instead of typing ">0"?

You can use an ampersand (&) to join the comparison operator with a cell reference. For example, if cell C1 contains the number 0, you would format your criteria as ">"&C1 inside the COUNTIFS formula.

Does COUNTIFS work across different worksheets?

Yes, you can reference ranges located in other worksheets. Simply click on the other worksheet while building your formula, or prefix the range with the sheet name and an exclamation mark, such as Sheet1!A1:A10.