How to Sum Positive Values by Week Number in Excel
Question details
The user needs to calculate the total of sales amounts for a specific week, ensuring that only values greater than zero are included in the sum.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing weekly sales data where the amounts are stored in column O, week numbers are in column R, and the target week is referenced in cell D24.
- Observed behavior
- The goal is to filter and calculate data simultaneously by applying two conditions: matching the specified week number and excluding zero or negative values.
Ensure that your data ranges for the week numbers and sales amounts cover the exact same number of rows to avoid formula errors. Also, verify that your sales amounts are formatted as numbers, not text.
Using the SUMIFS Function
The SUMIFS function is the most efficient and recommended way to sum values based on multiple criteria, such as matching a week number and filtering for positive numbers.
SUMIFS allows you to specify multiple conditions across different ranges. In this scenario, the sales amount column is used twice: once as the primary range to sum, and again as a criteria range to check for values greater than zero.
Click on the cell where you want the final calculated total to appear.
Type the formula: =SUMIFS(Sheet1!$O$5:$O$1000, Sheet1!$R$5:$R$1000, D24, Sheet1!$O$5:$O$1000, ">0")
If your data extends beyond row 1000, replace the $5:$1000 portions with your actual data range boundaries.
Press Enter to execute the formula and view the sum of positive values for the targeted week.

Using the SUMPRODUCT Function (Alternative)
If you are working with an older spreadsheet version that does not support the SUMIFS function, you can use SUMPRODUCT to achieve the exact same result.
Easily Calculate Multi-Condition Sums with WPS Spreadsheet
WPS Spreadsheet fully supports advanced logical and math functions like SUMIFS and SUMPRODUCT, allowing you to seamlessly analyze weekly sales data and perform multi-condition calculations without any lag.
- 1. Open your workbook: Launch WPS Office and open your Excel workbook containing the weekly sales data.
- 2. Locate the Formula tab: Select the cell for your result, then go to the 'Formulas' tab on the top ribbon.
- 3. Insert the SUMIFS function: Click 'Insert Function', search for 'SUMIFS', and click OK to open the function arguments dialog.
- 4. Input the criteria: Fill in the sum range and criteria fields as prompted by the dialog box, then click OK to calculate the positive sales sum.

Frequently Asked Questions
Why does my SUMIFS formula return a #VALUE! error?
This error usually occurs when the sum range and the criteria ranges are not identically sized. Ensure that ranges like $O$5:$O$1000 and $R$5:$R$1000 cover the exact same number of rows and columns.
Can I reference the ">0" criteria from another cell instead of hardcoding it?
Yes. If you have the target value (e.g., 0) in cell E1, you can concatenate the logical operator with the cell reference by writing ">"&E1 in the criteria section of your SUMIFS formula.
How do I include zero values but exclude negative values?
To include exact zero values in your calculation, simply change the criteria argument in the formula from ">0" to ">=0".




