Function Problems

How to SUM Values When Either of Two Conditions is True in Excel

Kushani NimanthikaKushani Nimanthika Nov 10, 2026 868 views

Question details

The user needs to sum values in a column based on an OR logic condition across two other columns.

How to SUM Values When Either of Two Conditions is True in Excel
Product
Excel
Device & OS
not provided
Scenario
Calculating a total sum where multiple criteria are evaluated as OR conditions rather than the default AND behavior of SUMIFS.
Observed behavior
Since SUMIFS only supports AND logic natively, the user requires alternative formulas like SUMPRODUCT or array formulas to calculate the sum when either column A or column B meets a specific criterion.
Before you start

Identify the columns containing your criteria and the column containing the values to be summed. Ensure your data ranges are consistent in size across the formula to avoid calculation errors.

Solution 1Recommended

Use SUMPRODUCT for Broad Compatibility

The SUMPRODUCT function is the most reliable way to apply OR logic across multiple columns without requiring special keystrokes or newer software versions.

In spreadsheet formulas, adding a plus sign (+) between two logical tests creates an OR condition. SUMPRODUCT evaluates these arrays natively without needing Ctrl+Shift+Enter.

1
Select a destination cell

Click the cell where you want the total calculated sum to appear.

2
Enter the SUMPRODUCT formula

Type =SUMPRODUCT((((A2:A11>0)+(B2:B11>0))>0)*C2:C11) and press Enter. This formula checks if the value in column A or column B is greater than 0, and multiplies the TRUE/FALSE result by the corresponding value in column C to get the sum.

Use SUMPRODUCT for Broad Compatibility
Version Compatibility: This formula works flawlessly in almost all versions of Excel and WPS Spreadsheet without requiring dynamic array support.

Easily Process Complex Formulas with WPS Spreadsheet

WPS Spreadsheet fully supports advanced logical formulas including SUMPRODUCT and array functions. You can seamlessly apply OR logic to your data calculations within a lightweight, highly compatible interface.

  1. 1. Download and install: Get WPS Office from the official website, install it, and open the WPS Spreadsheet module.
  2. 2. Open your workbook: Load your existing Excel file containing the data ranges to be summed.
  3. 3. Apply the formula: Use the SUMPRODUCT formula just as you would in Excel to instantly calculate your OR logic sums without formatting loss.
Free and lightweight spreadsheet data analysis toolFully compatible with Microsoft Excel file formats (.xlsx)Native support for complex OR logic formulas like SUMPRODUCTFamiliar interface with zero learning curve for Excel users
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I just use SUMIFS for this calculation?

The SUMIFS function is hardcoded to use AND logic, meaning all criteria must be met for a row to be summed. To use OR logic (where only one of the conditions needs to be true), you must use alternative functions like SUMPRODUCT or SUM combined with IF.

What does the plus sign (+) do in the SUMPRODUCT formula?

In spreadsheet array formulas, the plus sign (+) acts as an OR operator. It adds the TRUE/FALSE results of two logical tests together. A result of 1 or greater means at least one condition is true, allowing the formula to include that row in the final sum.

Why is my SUM(IF) formula returning a #VALUE! error?

If you are using an older version of Excel, you must confirm the SUM(IF) array formula by pressing Ctrl+Shift+Enter instead of just pressing Enter. If you do not use this shortcut, the spreadsheet software will not evaluate the arrays correctly and will return a #VALUE! error.