OR Within SUMIFS: How to Use It in Excel

Formulas & functions · Updated November 22, 2026

Yes, you can use OR logic within SUMIFS, but not directly in the function’s criteria arguments. SUMIFS inherently applies AND logic across all criteria pairs. To sum with OR conditions, you combine multiple SUMIFS functions or use an array formula with SUMPRODUCT. This article explains both methods, when to use each, and common pitfalls.

Why SUMIFS Doesn’t Support OR Directly

SUMIFS is designed to sum values that meet all specified criteria simultaneously. Each criteria_range/criteria pair adds an AND condition. For example, =SUMIFS(C2:C20, A2:A20, "Red", B2:B20, "Large") sums only rows where column A is “Red” and column B is “Large”. There is no built-in OR operator like "Red" OR "Blue" in a single criteria. This is a common misconception; users often try "Red" + "Blue" or {"Red","Blue"} and get errors or wrong results.

Method 1: Add Multiple SUMIFS (The Simple OR)

The most straightforward way to apply OR logic is to add two or more SUMIFS functions. Each SUMIFS handles one OR condition, and the sum of them gives the total that meets any condition. This works perfectly when the OR conditions are mutually exclusive – meaning a row cannot satisfy both conditions simultaneously. If a row could satisfy both, you’d double-count it.

Example: Sum sales in column C where product is either “Widget” or “Gadget”.

  • Assume products in A2:A20, sales in C2:C20.
  • Formula: =SUMIFS(C2:C20, A2:A20, "Widget") + SUMIFS(C2:C20, A2:A20, "Gadget")
  • If sales for Widget total 150 and for Gadget total 200, the result is 350.

This method is simple, easy to read, and works in all Excel versions. However, if you have many OR conditions, the formula becomes long. Also, if a row could match both criteria (e.g., “Widget” in column A and “Gadget” in column B), you must ensure the conditions are mutually exclusive or adjust the formula.

Method 2: SUMPRODUCT with OR Logic (Array Formula)

When OR conditions are not mutually exclusive, or you want a single formula, use SUMPRODUCT. It evaluates arrays and can handle OR by using addition inside the logical tests. The syntax is:

=SUMPRODUCT((range1=crit1)+(range2=crit2), sum_range)

The + acts as OR. Each comparison returns TRUE (1) or FALSE (0). Adding them gives 1 if at least one is true, 2 if both are true. Multiplying by the sum range and summing gives the total. To avoid double-counting when both are true, you can use --((range1=crit1)+(range2=crit2)>0) to force 1/0.

Example: Sum sales where product is “Widget” OR region is “North”.

  • Products in A2:A20, regions in B2:B20, sales in C2:C20.
  • Formula: =SUMPRODUCT((A2:A20="Widget")+(B2:B20="North"), C2:C20)
  • If a row has both “Widget” and “North”, it contributes twice. To prevent that, use: =SUMPRODUCT(--((A2:A20="Widget")+(B2:B20="North")>0), C2:C20)
  • Assume sales: Widget rows total 100, North rows total 80, overlap row has 20. The first formula returns 200 (100+80+20+20? Actually 100+80+20+20=220? Let’s recalc: Widget rows sum to 100, North rows sum to 80, but overlap row is included in both, so total unique is 100+80-20=160. The first formula gives 100+80+20=200? No, it gives 100+80+20 (overlap counted twice) = 200. The second gives 100+80-20=160. So the second is correct for unique sum.

SUMPRODUCT is powerful but can be slower on large datasets and less intuitive. It works in all Excel versions without needing Ctrl+Shift+Enter.

Method 3: Using Array Constants with SUMIFS (Excel 365)

In Excel 365 and Excel 2021, you can use array constants inside SUMIFS to get OR behavior. For example, =SUM(SUMIFS(C2:C20, A2:A20, {"Widget","Gadget"})) sums the results of two SUMIFS, one for each item. The SUMIFS returns an array of two numbers, and SUM adds them. This is concise but requires entering as a normal formula (it spills automatically in 365). It works similarly to adding multiple SUMIFS, so double-counting is an issue if conditions overlap.

Example: Same as Method 1, but with array constant: =SUM(SUMIFS(C2:C20, A2:A20, {"Widget","Gadget"})). If Widget sum is 150 and Gadget is 200, result is 350.

This method is neat but only works in Excel 365 or 2021. In older versions, it requires Ctrl+Shift+Enter.

How to Choose the Right Method

  • Mutually exclusive OR conditions (e.g., different product names) → Use multiple SUMIFS or array constant. Simple and fast.
  • Overlapping OR conditions (e.g., product OR region) → Use SUMPRODUCT with the >0 trick to avoid double-counting.
  • Many OR conditions (more than 3) → Consider using a helper column with a formula like =OR(A2="Widget",B2="North") and then SUMIF on that column. This is often easier to maintain.
  • Compatibility → If you share files with users on older Excel, avoid array constants and use SUMPRODUCT or multiple SUMIFS.

Common Mistakes and How to Fix Them

  • Using OR as a function inside SUMIFS: =SUMIFS(C2:C20, A2:A20, OR("Widget","Gadget")) does not work. OR returns a single TRUE/FALSE, not a range.
  • Double-counting: When using multiple SUMIFS, ensure conditions don’t overlap. If they do, use SUMPRODUCT with the >0 method.
  • Wrong data types: Criteria must match exactly, including text case (unless you use wildcards). For numbers, ensure no text-formatted numbers.
  • Array constant syntax: Use curly braces {} and commas for columns, semicolons for rows. In Excel 365, you don’t need Ctrl+Shift+Enter, but in older versions you must.

Real-World Example: Sales Dashboard

Imagine you have a sales table: Product (A), Region (B), Sales (C). You want to sum sales for either “Widget” in the North region OR “Gadget” in the South region. This is a complex OR of two AND conditions. You can write:

=SUMIFS(C2:C20, A2:A20, "Widget", B2:B20, "North") + SUMIFS(C2:C20, A2:A20, "Gadget", B2:B20, "South")

If a row could be both (e.g., “Widget” in North and also “Gadget” in South), that’s impossible because a row has one product and one region, so no overlap. This formula is safe.

For a more dynamic approach, you could use SUMPRODUCT with multiplication for AND and addition for OR:

=SUMPRODUCT(((A2:A20="Widget")*(B2:B20="North"))+((A2:A20="Gadget")*(B2:B20="South")), C2:C20)

This returns the same result and is a single formula.

Frequently Asked Questions

Can I use wildcards with OR in SUMIFS?

Yes, wildcards like * and ? work in SUMIFS criteria. For OR with wildcards, you can use multiple SUMIFS or SUMPRODUCT with wildcard matching. For example, to sum products starting with “W” or “G”, use =SUMIFS(C2:C20, A2:A20, "W*") + SUMIFS(C2:C20, A2:A20, "G*").

Does SUMPRODUCT work with entire columns?

Yes, but using entire columns like A:A can slow down calculation. It’s better to limit to the used range, e.g., A2:A1000.

Why does my SUMIFS return 0 when using OR?

Likely because you used OR as a function or used array constants without proper syntax. Check that your criteria are in the correct order and that the ranges are the same size.

Can I use OR in SUMIFS with dates?

Yes, treat dates as criteria. For example, to sum sales in January or February, use =SUMIFS(C2:C20, B2:B20, ">=1/1/2023", B2:B20, "<=1/31/2023") + SUMIFS(C2:C20, B2:B20, ">=2/1/2023", B2:B20, "<=2/28/2023"). Ensure dates are entered as date values, not text.

Is there a way to use OR in SUMIFS with cell references?

Yes, you can reference cells containing criteria. For multiple OR values, you can list them in cells and use array constants or SUMPRODUCT. For example, if D1 contains "Widget" and D2 contains "Gadget", use =SUM(SUMIFS(C2:C20, A2:A20, D1:D2)) in Excel 365, but this requires the criteria range to be a vertical array. In older versions, use SUMPRODUCT with ISNUMBER(MATCH()).

Performance and Best Practices

For large datasets (thousands of rows), multiple SUMIFS are generally faster than SUMPRODUCT because SUMIFS is optimized. However, SUMPRODUCT with array operations can be slower. If you need OR logic on a large dataset, consider adding a helper column that flags rows with a formula like =IF(OR(A2="Widget",B2="North"),1,0) and then use =SUMIF(helper_range,1,sum_range). This is often the fastest and easiest to maintain.

Also, avoid using entire column references in SUMPRODUCT to prevent calculating over a million rows. Use explicit ranges.

Alternatives to SUMIFS for OR Logic

If you find SUMIFS too limiting, consider using the FILTER function (Excel 365) to get an array of matching values and then SUM. For example, =SUM(FILTER(C2:C20, (A2:A20="Widget")+(B2:B20="North"))). This gives you OR logic directly, but it's only available in Excel 365 and 2021. In older versions, you could use DSUM with a criteria range, but that's more complex. Ultimately, the best method depends on your Excel version and the complexity of your conditions.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.