search
HomeTopicsexcelGoogle Sheets SUMIFS to sum cells with multiple AND / OR criteria

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
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
MEDIAN formula in Excel - practical examplesMEDIAN formula in Excel - practical examplesApr 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

Google Spreadsheet COUNTIF function with formula examplesGoogle Spreadsheet COUNTIF function with formula examplesApr 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

Excel shared workbook: How to share Excel file for multiple usersExcel shared workbook: How to share Excel file for multiple usersApr 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

How to convert Excel to JPG - save .xls or .xlsx as image fileHow to convert Excel to JPG - save .xls or .xlsx as image fileApr 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

Excel names and named ranges: how to define and use in formulasExcel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AM

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

Standard deviation Excel: functions and formula examplesStandard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AM

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

Square root in Excel: SQRT function and other waysSquare root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AM

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Google Sheets basics: Learn how to work with Google SpreadsheetsGoogle Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AM

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate

See all articles

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.