Home Topics excel Google Sheets SUMIFS to sum cells with multiple AND / OR criteria

Google Sheets SUMIFS to sum cells with multiple AND / OR criteria

Apr 07, 2025 am 10:11 AM

This tutorial demonstrates how to use the SUMIFS function in Google Sheets to sum cells based on multiple criteria. Several real-world examples are provided, showcasing both AND and OR logic.

Google Sheets offers two functions for conditional summation: SUMIF and SUMIFS. While SUMIF handles single criteria, SUMIFS excels with multiple conditions.

The key difference:

  • SUMIF: Sums cells based on a single condition.
  • SUMIFS: Sums cells based on two or more conditions.

This tutorial explains SUMIFS syntax and provides formula examples for various data types.

Table of Contents:

  • Google Sheets SUMIFS Function: Syntax and Basic Usage
  • Summing Cells with Multiple AND Criteria
    • SUMIFS with Logical Operators
    • SUMIFS with Other Functions
    • SUMIFS with Blank and Non-Blank Cells
  • Summing Cells with Multiple OR Criteria
    • SUMIF with OR Logic (Criteria in One Column)
    • SUMIF with OR Criteria and Results in Separate Cells
    • SUMIFS with OR Logic (Criteria in Different Columns)

See the colors, sum the numbers! Effortlessly sum cells based on their fill color using Ablebits Data.

Google Sheets SUMIFS to sum cells with multiple AND / OR criteria

Try Ablebits Data now! Duplicates? Merge, Sum, Done!

Identify duplicates, combine data, and calculate totals with ease.

Google Sheets SUMIFS to sum cells with multiple AND / OR criteria

Try Ablebits Data now! Unlock the full potential of your Google Sheets.

Google Sheets SUMIFS to sum cells with multiple AND / OR criteria

Discover the Ablebits Data collection.

Google Sheets SUMIFS Function: Syntax and Basic Usage

The SUMIFS function in Google Sheets sums numbers based on multiple conditions. Its arguments are:

SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...])

Where:

  • sum_range (required): The range of cells to sum.
  • criteria_range1 (required): The range evaluated against criterion1.
  • criterion1 (required): The condition for cells in criteria_range1.
  • criteria_range2, criterion2, ... (optional): Additional ranges and criteria.

Three Key Points for Using SUMIFS:

  1. SUMIFS sums only cells meeting all conditions (AND logic).
  2. The sum_range and all criteria_ranges must be the same size. Otherwise, a #VALUE error occurs.
  3. Criteria construction depends on data type:
    • Text, wildcards, and dates require quotes (e.g., "apples", "*", "4/19/2024").
    • Numbers and cell references don't need quotes (unless part of a logical expression).
    • Logical operators with numbers, dates, or text need quotes (e.g., ">200", ">4/19/2024", "apples").
    • Logical operators with cell references and functions require concatenation (e.g., ">="&B1 or ">="&TODAY()).

Summing with Multiple Criteria (AND Logic)

Let's say you have items in column A, amounts in column B, and delivery status in column C. To find the total for "apples" that are "delivered":

Avoid complex ARRAYFORMULA and SUMPRODUCT solutions. Instead, use SUMIFS:

  • criteria_range1: A2:A13, criterion1: "apples"
  • criteria_range2: C2:C13, criterion2: "delivered"
  • sum_range: B2:B13

The simple formula is:

=SUMIFS(B2:B13, A2:A13, "apples", C2:C13, "delivered")

For greater flexibility, use cell references for criteria:

=SUMIFS(B2:B13, A2:A13, F1, C2:C13, F2)

(Image showing SUMIFS example with AND logic)

SUMIFS with Logical Operators

For numerical or date criteria, use comparison operators: =, , >, =,

Example: Sum amounts in B2:B13 greater than or equal to 200 and delivered before April 1st, 2024:

=SUMIFS(B2:B13, B2:B13, ">=200", C2:C13, "

Using cell references:

=SUMIFS(B2:B13, B2:B13, ">="&F1, C2:C13, "

(Image showing SUMIFS example with logical operators)

SUMIFS with Other Functions

Conditions can depend on other functions. Embed these functions within the criteria.

Example: Sum "apples" delivered on or before today:

=SUMIFS(B2:B13, A2:A13, "apples", C2:C13, "

(Image showing SUMIFS example with other functions)

SUMIFS with Blank and Non-Blank Cells

  • "=" for completely blank cells.
  • "" for empty cells (including zero-length strings).
  • "" for non-blank cells (including zero-length strings).

Example: Sum "apples" with a delivery date (non-blank C column):

=SUMIFS(B2:B13, A2:A13, "apples", C2:C13, "")

(Image showing SUMIFS example with blank/non-blank cells)

Summing with Multiple Criteria (OR Logic)

SUMIFS uses AND logic by default. For OR logic, use multiple SUMIF functions or SUMPRODUCT.

SUMIF with OR Criteria (Same Column)

For a few criteria in the same column, add SUMIF functions:

=SUMIF(A:A, "apples", B:B) SUMIF(A:A, "bananas", B:B)

For more criteria, use ARRAYFORMULA and SUM:

=SUM(ARRAYFORMULA(SUMIF(A2:A13, {"apples", "bananas", "lemons"}, B2:B13)))

Or SUMPRODUCT:

=SUMPRODUCT((A2:A13={"apples", "bananas"}) \* B2:B13)

(Image showing SUMIF example with OR logic in the same column)

SUMIF with OR Criteria and Results in Different Cells

To get subtotals in separate cells, use ARRAYFORMULA (without SUM):

=ARRAYFORMULA(SUMIF(A2:A13, {"apples", "bananas", "lemons"}, B2:B13))

(Image showing SUMIF example with OR logic and results in different cells)

SUMIFS with OR Criteria (Different Columns)

For multiple sets of conditions (AND within sets, OR between sets), use SUMPRODUCT:

Example: Sum amounts where column A is "apples" OR "oranges" AND column C is "3/16/2024":

=SUMPRODUCT(--(C2:C13="3/16/2024"), (--(ISNUMBER(MATCH(A2:A13, {"apples", "oranges"}, 0)))), B2:B13)

(Image showing SUMIFS example with OR logic in different columns)

This tutorial provides a comprehensive guide to using SUMIFS in Google Sheets. For further examples, refer to the provided spreadsheet.

The above is the detailed content of Google Sheets SUMIFS to sum cells with multiple AND / OR criteria. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1248
24
MEDIAN formula in Excel - practical examples MEDIAN formula in Excel - practical examples Apr 11, 2025 pm 12:08 PM

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Excel shared workbook: How to share Excel file for multiple users Excel shared workbook: How to share Excel file for multiple users Apr 11, 2025 am 11:58 AM

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

Google Spreadsheet COUNTIF function with formula examples Google Spreadsheet COUNTIF function with formula examples Apr 11, 2025 pm 12:03 PM

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

How to convert Excel to JPG - save .xls or .xlsx as image file How to convert Excel to JPG - save .xls or .xlsx as image file Apr 11, 2025 am 11:31 AM

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

Google sheets chart tutorial: how to create charts in google sheets Google sheets chart tutorial: how to create charts in google sheets Apr 11, 2025 am 09:06 AM

This tutorial shows you how to create various charts in Google Sheets, choosing the right chart type for different data scenarios. You'll also learn how to create 3D and Gantt charts, and how to edit, copy, and delete charts. Visualizing data is cru

Excel dynamic named range: how to create and use Excel dynamic named range: how to create and use Apr 11, 2025 am 10:19 AM

This tutorial shows you how to create and use dynamic named ranges in Excel, automatically updating calculations as your data changes. Unlike static named ranges, dynamic ranges adjust to include new data without manual intervention. Last week's tut

How to flip data in Excel columns and rows (vertically and horizontally) How to flip data in Excel columns and rows (vertically and horizontally) Apr 11, 2025 am 09:05 AM

This tutorial demonstrates several efficient methods for vertically and horizontally flipping tables in Excel, preserving original formatting and formulas. While Excel lacks a direct "flip" function, several workarounds exist. Flipping Dat

How to do calculations in Excel How to do calculations in Excel Apr 11, 2025 am 10:20 AM

This tutorial demonstrates how to perform arithmetic calculations within Microsoft Excel and modify the order of operations in your formulas. Excel's capabilities extend far beyond simple addition; it can handle complex calculations, thanks to its h

See all articles