How to Count Values Greater Than Zero With COUNTIFS in Excel
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.

- 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.
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.
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".
Click on the empty cell where you want the final count to be displayed.
Type =COUNTIFS( into the cell or the formula bar to initiate the function.
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).
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.
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 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. Open your file in WPS Office: Launch WPS Spreadsheet and open your existing Excel file (.xlsx or .xls).
- 2. Select a cell for the result: Click on the cell where you want to display the counted total.
- 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. Press Enter to calculate: Hit Enter on your keyboard to instantly calculate and display your counted values.

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.




