How to Use SUMPRODUCT with Multiple Criteria and OR Date Conditions
Question details
The user needs to write a SUMPRODUCT formula to count rows based on two exact match criteria and an OR condition checking if either of two columns contains a date in a specific month.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Counting data rows that meet strict multiple conditions, including an OR logic condition across two separate date columns.
- Observed behavior
- The user needs the correct formula syntax and a solution for array size mismatch errors caused by uneven range references.
Double-check that all your data ranges have the exact same starting and ending row numbers (e.g., row 3 to 503), as uneven arrays will cause a #VALUE! error in SUMPRODUCT.
Use SUMPRODUCT with Array Multiplication and Addition
Combine AND logic using multiplication (*) and OR logic using addition (+) within the SUMPRODUCT function.
In the SUMPRODUCT function, multiplying arrays acts as an AND operator, while adding them acts as an OR operator. To prevent double-counting when both date columns have an August date, we wrap the addition in a condition checking if the sum is greater than zero (>0).
It is also critical that every range reference is absolute and perfectly aligned.
Click the cell where you want the final calculated count to appear.
Begin the formula by multiplying the required text matches: `(Master_Calendar!$C$3:$C$503="YES")*(Master_Calendar!$F$3:$F$503="Standalone Service")`.
Add the OR condition to check for the month of August (month 8) in either column AA or AB: `(((MONTH(Master_Calendar!$AA$3:$AA$503)=8)+(MONTH(Master_Calendar!$AB$3:$AB$503)=8))>0)`.
Combine all parts into the SUMPRODUCT function: `=SUMPRODUCT((Master_Calendar!$C$3:$C$503="YES")*(Master_Calendar!$F$3:$F$503="Standalone Service")*(((MONTH(Master_Calendar!$AA$3:$AA$503)=8)+(MONTH(Master_Calendar!$AB$3:$AB$503)=8))>0))` and press Enter.

Easily Manage Complex Formulas in WPS Spreadsheet
WPS Spreadsheet fully supports advanced array functions like SUMPRODUCT, making it easy to analyze your data with multiple criteria. It offers a familiar interface, color-coded range highlights, and seamless compatibility with Microsoft Excel formulas.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data.
- 2. Start the SUMPRODUCT function: Click on the target cell and type `=SUMPRODUCT(`.
- 3. Select ranges: Highlight your data ranges using the mouse. WPS will automatically highlight different arrays in distinct colors to help you verify their sizes.
- 4. Input logic operators: Input your multiplication (*) for AND criteria and addition (+) for OR criteria as needed.
- 5. Calculate: Add the closing parenthesis and press Enter to instantly get your calculated results.

Frequently Asked Questions
Why does my SUMPRODUCT formula return a #VALUE! error?
The most common cause of a #VALUE! error in SUMPRODUCT is mismatched array sizes. Ensure that all ranges in your formula (e.g., C3:C503 and F3:F503) have the exact same number of rows and columns.
How do I check for a specific year and month in SUMPRODUCT?
You can add a YEAR function to your condition. For example, to check for August 2023, you would multiply the conditions: `((MONTH(A2:A100)=8)*(YEAR(A2:A100)=2023))`.
Why use the >0 check in the OR date condition?
In Boolean logic, adding two TRUE arrays might return 2 if both conditions are met in the same row. Checking `>0` converts any positive number back to 1 (TRUE), ensuring that a row is only counted once even if both date columns contain a date in August.




