How to Use OR Inside SUMIFS in Google Sheets
In this article
You cannot put OR directly inside SUMIFS because SUMIFS treats multiple criteria as AND. The working solution is to add two or more SUMIFS formulas together, or to use SUMPRODUCT with Boolean logic. For example, to sum amounts where the region is East or West, use =SUMIFS(C2:C100, A2:A100, "East") + SUMIFS(C2:C100, A2:A100, "West"). This guide walks through both methods, shows how to combine OR with other AND criteria, and covers the mistakes that produce wrong totals.
What You'll Need
- A Google account with access to Google Sheets (desktop browser or the Sheets mobile app).
- A spreadsheet with at least one criteria column and one numeric column to sum.
- Basic familiarity with cell references and ranges (for example, A2:A100).
Step-by-Step
Method 1: Add Multiple SUMIFS Together (Simplest)
- Open your spreadsheet and click an empty cell where the total should appear.
- Type
=SUMIFS(to start the formula. The first argument is the sum range: the numbers you want to add up. - Enter the sum range, a comma, then the first criteria range and the first criterion. For example:
SUMIFS(C2:C100, A2:A100, "East"). This sums column C where column A equals East. - Type
+and repeat the SUMIFS for the second OR condition:SUMIFS(C2:C100, A2:A100, "West"). - Close the parenthesis and press Enter. The result is the total for East plus West.
- To add more OR values, keep adding
+SUMIFS(...)blocks. Each block handles one alternative.
This method is easy to read and works in every version of Sheets. The downside is that each additional OR value makes the formula longer.
Method 2: SUMPRODUCT with Boolean OR (Compact for Many Values)
- Click an empty cell and type
=SUMPRODUCT(. - Enter the sum range, then multiply it by a Boolean expression for the OR condition. For two values, use
((A2:A100="East")+(A2:A100="West")>0). - The full formula looks like:
=SUMPRODUCT(C2:C100 * ((A2:A100="East")+(A2:A100="West")>0)). - Press Enter. SUMPRODUCT multiplies each row's value by 1 if the row matches either condition, and by 0 if not, then adds the results.
- For three or more values, add more
+(range="value")terms inside the parentheses before the>0.
SUMPRODUCT handles arrays natively, so you do not need to press Ctrl+Shift+Enter. It is the better choice when you have many OR values or when you want to avoid a very long formula.
Combining OR with AND Conditions
SUMIFS already handles AND logic across different criteria ranges. To sum where region is East or West AND the month is January, add an extra criteria pair to each SUMIFS block:
=SUMIFS(C2:C100, A2:A100, "East", B2:B100, "January") + SUMIFS(C2:C100, A2:A100, "West", B2:B100, "January")
For SUMPRODUCT, multiply the OR expression by the AND condition:
=SUMPRODUCT(C2:C100 * ((A2:A100="East")+(A2:A100="West")>0) * (B2:B100="January"))
This gives you OR within one column and AND across columns, which is what most real reports need.
Using Cell References Instead of Hard-Coded Text
- Put your OR values in separate cells, for example E2 contains East and E3 contains West.
- In the SUMIFS version, reference each cell:
=SUMIFS(C2:C100, A2:A100, E2) + SUMIFS(C2:C100, A2:A100, E3). - In the SUMPRODUCT version, reference the cells inside the Boolean expression:
=SUMPRODUCT(C2:C100 * ((A2:A100=E2)+(A2:A100=E3)>0)). - Change the values in E2 and E3 to update the total without editing the formula.
Common Mistakes
- Trying to put OR inside SUMIFS. Writing
SUMIFS(C2:C100, A2:A100, "East", A2:A100, "West")returns 0 because a single cell cannot equal two different values at once. SUMIFS joins criteria with AND, not OR. - Forgetting the >0 in SUMPRODUCT. Without
>0, a row that matches both conditions would be counted twice. The comparison forces the result to 1 or 0. - Mismatched range sizes. All ranges in SUMIFS and SUMPRODUCT must be the same height and width, or you get a #VALUE! error.
- Text vs. numbers. If the criteria column contains numbers stored as text,
"100"may not match100. Use consistent data types or the VALUE function. - Wildcards in SUMPRODUCT. SUMPRODUCT does not support wildcards like * or ? in the same way SUMIFS does. Use SUMIFS when you need partial matches.
Tips
- Name your ranges (Data > Named ranges) to make long formulas readable.
- Use
SUMIFSwhen you have two or three OR values and need wildcard support; useSUMPRODUCTwhen you have many OR values or need to avoid helper columns. - Wrap the whole formula in
IFERROR(..., 0)to show 0 instead of an error when no rows match. - Test with a small range first, then expand to the full dataset.
- On mobile, the Sheets app supports both functions, but typing long formulas is easier on desktop.
Troubleshooting
- Formula returns 0 unexpectedly. Check for leading or trailing spaces in the criteria column. Use TRIM or clean the data. Also confirm the sum range contains numbers, not text.
- #VALUE! error. Verify all ranges are the same size. In SUMPRODUCT, make sure you did not include a whole column reference that includes text headers.
- #NAME? error. Check the spelling of SUMIFS and SUMPRODUCT, and ensure quotation marks are straight, not curly.
- Wrong total with SUMPRODUCT. Confirm the Boolean expression is wrapped in parentheses before multiplying. Without parentheses, operator precedence can give unexpected results.
- Criteria not matching. Dates and numbers may be stored as text. Use DATEVALUE or VALUE to convert, or match the format exactly.
Frequently Asked Questions
Can I use OR directly inside SUMIFS?
No. SUMIFS combines all criteria with AND. To get OR behavior, add multiple SUMIFS formulas together or use SUMPRODUCT with Boolean logic.
What is the difference between SUMIFS and SUMPRODUCT for OR logic?
SUMIFS is simpler for a few OR values and supports wildcards. SUMPRODUCT is more compact for many OR values and handles arrays without helper columns, but it does not support wildcards the same way.
How do I sum with OR across multiple columns?
Use SUMPRODUCT with addition across column expressions, for example =SUMPRODUCT((A2:A100="East")+(B2:B100="East")>0, C2:C100). This sums column C where either column A or column B equals East.
Why does my SUMIFS with OR return 0?
Most often because the criteria are in the same range, which forces AND logic. Move each OR value to a separate SUMIFS block. Also check for extra spaces or text-formatted numbers.
Can I use cell references for the OR values?
Yes. Replace the hard-coded text with cell references in both methods. This lets you change the criteria without editing the formula.
Does SUMPRODUCT work on Google Sheets mobile?
Yes, both SUMIFS and SUMPRODUCT work in the Sheets mobile app. The formula bar is smaller, so consider building the formula on desktop and opening it on mobile.