Learn how to use the SUMIF formula in Excel

Learn How to Use the SUMIF Formula in Excel

Summary:- Our guide explains how to use the SUMIF formula in Excel to conditionally sum data quickly. It covers syntax, troubleshooting, practical examples, and wildcard usage. Enhance your spreadsheet skills and boost data analysis by learning this powerful tool. Follow our steps to streamline your Excel calculations and improve efficiency effectively.

Introduction

Ever felt like your Excel sheets are drowning in numbers, and you just want a quick way to add up only the ones that matter? That’s where SUMIF comes to the rescue! This powerful Excel function helps you sum values based on a condition—like totalling sales above a certain amount or adding up expenses in a specific category.

Knowing how to use the SUMIF formula in Excel makes data analysis effortless. Given that Excel holds 7.55% of the productivity market and contributed $44.9 billion to Microsoft in 2023, mastering it is a skill worth having! Let’s dive in and simplify your spreadsheets. 

Key Takeaways

  • Learn how to use the SUMIF formula in Excel for conditional summing.
  • Understand the syntax: range, criteria, and optional sum_range.
  • Troubleshoot errors like mismatched ranges and incorrect criteria.
  • Use wildcards and date conditions to refine data analysis.
  • Enhance Excel skills and boost productivity through practical examples.

Understanding the SUMIF Function: Syntax and Usage

The Excel SUMIF function helps you add values based on a specific condition. It is also called the Excel conditional sum because it only includes numbers that meet the given criteria. 

This function is helpful for tasks like calculating total sales for a specific product, summing expenses above a certain amount, or finding the total revenue for a particular date range.

SUMIF Function Syntax

The SUMIF function follows this structure:

SUMIF function syntax structure in Excel

It has three parts:

  • Range (Required): The group of cells to check for the condition.
  • Criteria (Required): The condition that determines which values to sum. It can be a number, text, date, logical expression, or cell reference. Example: “10”, “>50”, “Bananas”, “<=20”.
  • Sum_range (Optional): The cells to add if the condition is met. If this is not provided, Excel sums the values in the range.

Basic Uses of SUMIF in Excel

The SUMIF function is available in Excel 365, Excel 2021, Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007, and older versions. You can use it in various ways, such as:

  • Summing sales for a specific product: Add up all sales where the product is “Apples”.
  • Finding total expenses above a limit: Calculate total spending exceeding 100 ₹.
  • Adding values based on dates: Sum orders made before or after a specific date.

Note: If your condition includes text or logical symbols (like >, <), enclose them in double-quotes. For example, use “Bananas” or “>50”. However, do not use quotes when referring to a cell; just type the cell reference.

This function makes working with large datasets easier by allowing quick and automatic calculations based on specific conditions.

Practical Examples of the SUMIF Formula

Hopefully, the following examples will help you understand how to use SUMIF in different scenarios.

Summing Values Based on Greater Than or Less Than Conditions

To sum numbers that are greater than or less than a certain value, you need to use comparison operators:

  • Greater than (>)
  • Greater than or equal to (>=)
  • Less than (<)
  • Less than or equal to (<=)

For example, suppose you have a dataset of sales where Column B contains the sales amount and Column C contains the number of days required for shipping. If you want to sum sales where shipping takes more than 3 days, use:

SUMIF formula to sum sales for shipping over 3 days

If the target number is in another cell, say F1, use:

SUMIF formula using a reference cell for criteria

Similarly, to sum sales where shipping takes less than 3 days:

 SUMIF formula to sum sales for shipping under 3 days

Summing Values That Match a Specific Condition

SUMIF can also sum values based on an exact match. This works for both numbers and text.

To sum up all sales where shipping takes exactly 3 days:

SUMIF formula to sum sales for exact 3-day shipping

For text values, say you want to sum sales of Apples in Column A:

 SUMIF formula summing sales for "Apples"

Summing Values That Do Not Match a Specific Condition

To sum values that do not meet a specific condition, use the not equal to (<>) operator.

For instance, to sum sales where shipping is not 3 days:

SUMIF formula excluding sales with 3-day shipping

To sum sales for all products except Apples:

 SUMIF formula summing sales for non-Apple items

Summing Only Blank Cells

SUMIF can sum values where the corresponding cell is blank.

If Column B has regions and Column C has sales, and you want to sum sales where region data is missing:

SUMIF formula summing sales for blank region entries

Summing Only Non-Blank Cells

To sum values where the corresponding cell is not empty, use the not blank (<>) operator.

For instance, to sum sales where a region is specified:

SUMIF formula summing sales for non-blank regions

Using Wildcards in SUMIF for Partial Matches

When working with large datasets in Excel, you may need to sum values based on partial matches instead of exact ones. The SUMIF function allows you to do this by using wildcard characters. Wildcards help match patterns in text, making your formulas more flexible and efficient.

Let’s explore how to use these special characters in SUMIF formulas and see some practical examples.

Understanding Wildcard Characters in SUMIF

Excel provides two wildcard characters for use in the SUMIF function:

  • Asterisk (*): Represents any number of characters. It can be used to match words that contain a certain sequence of letters.
  • Question mark (?): Represents a single character in a specific position.

These wildcards help sum values based on text patterns rather than exact words.

Example 1: Summing Values Based on a Partial Match

Imagine you have sales data for North, North-East, and North-West regions. You want to sum sales for all regions that start with “North.” Here’s how you can do it:

SUMIF formula summing values starting with "North"

If you want to find “North” anywhere in the text (not just at the beginning), place asterisks on both sides:

SUMIF formula summing values containing "North"

You can also reference a cell (e.g., F1) instead of typing the text directly:

SUMIF formula using cell reference with wildcard

Example 2: Summing Values When the Text Contains * or ?

If your dataset includes literal asterisks (*) or question marks (?), Excel treats them as wildcards. To search for these symbols, add a tilde (~) before them.

For instance, if you want to sum values where column B contains an asterisk (*), use:

SUMIF formula summing values with an asterisk

Example 3: Summing Values Only When Another Cell Contains Text

If you only want to sum values when another column contains text (not numbers, blanks, or errors), use this formula:

SUMIF formula summing values based on text entries

This ensures only text-based rows contribute to the sum. If you want to include even blank text values, use:

 SUMIF formula summing values where text exists

These formulas are useful when dealing with mixed data types in your spreadsheet.

Summing Values Based on Date Conditions

You may need to sum values based on specific date conditions when working with Excel. 

For example, calculate total sales before a certain date, after a certain date, or within a specific date range. Excel’s SUMIF function allows you to do this easily by using dates as criteria. However, it’s important to correctly format dates so Excel can recognise them.

How to Use Excel SUMIF with Dates

Using dates as criteria in SUMIF is similar to using numbers. The key is to ensure that Excel recognises the date format. If you’re unsure, the DATE function can help.

For example, to sum sales for items delivered before September 10, 2020, use:

SUMIF formula summing values before a date

Or use the DATE function for clarity:

SUMIF formula using the DATE function

Alternatively, if the target date is in cell F1, use:

SUMIF formula with a cell reference for the date

Summing Values Based on Today’s Date

To sum sales with a delivery date before today, use:

 SUMIF formula summing values before today’s date

This formula dynamically updates every day.

Summing Values Between Two Dates

To sum values between a start date (F1) and an end date (G1), use SUMIFS (which allows multiple conditions):

SUMIFS formula summing values within a date range

This helps in analysing sales data for a specific month or quarter.

Applying SUMIF Across Multiple Sheets

When working with Excel, you may have data spread across multiple sheets, such as sales records for different regions. Instead of manually adding data from each sheet, you can use the SUMIF function to sum values based on a condition, even if the data is on another sheet. Here’s how you can do it.

  • Start the SUMIF Formula
    • Click on the cell where you want the result.
    • Type =SUMIF( to begin the formula.
  • Select the Range from Another Sheet
    • Switch to the sheet containing the data.
    • Click and drag to select the range you want to evaluate for the condition.
    • Excel will automatically insert the sheet name in the formula (e.g., Data!B2:B10).
  • Enter the Condition
    • Go back to the original sheet and click on the cell containing the condition (e.g., B3).
  • Select the Sum Range
    • Return to the data sheet and select the range containing values to sum (e.g., Data!C2:C10).
  • Close the Formula and Press Enter
  • Your final formula will look like this:
    SUMIF formula summing values from another sheet
  • This formula sums values in column C where column B matches the condition in B3.

Example: Summing Sales Data from Multiple Regions

Imagine you have sales data for different regions stored on a sheet named “Data”:

Table showing sales data by region

If you want to find the total sales for “North” on another sheet, place “North” in B3 and use:

SUMIF formula summing sales data by region

This formula will sum all sales where the region is “North”

Correct Usage of Cell References in SUMIF Criteria

When using the SUMIF formula in Excel, correctly referencing cells is crucial for accurate results. Instead of typing values directly into the formula, you can use cell references to make the formula more flexible and easy to update. This ensures that the formula automatically adjusts without editing if the value changes.

Absolute vs. Relative Cell References in SUMIF

There are two types of cell references in Excel:

  • Relative references (e.g., F1) change when copied to another cell.
  • Absolute references (e.g., $F$1) remain fixed, no matter where the formula is copied.

Using the right reference type prevents errors when dragging formulas across multiple cells.

How to Use Cell References Correctly in SUMIF

For a simple condition like “sum if equal to,” you can directly use a cell reference:

=SUMIF(C2:C10, F1, B2:B10)

However, if you use a comparison operator (like greater than >, less than <, or not equal to <>), you must convert the condition into a text string. You do this by enclosing the operator in quotation marks (“”) and connecting it with the reference using an ampersand (&):

=SUMIF(C2:C10, “>”&F7, B2:B10)

Here, the formula sums values from B2:B10 where corresponding values in C2:C10 are greater than the number in F7.

Common Mistakes and How to Avoid Them

  • Forgetting to use quotation marks with operators:  Writing =SUMIF(C2:C10, >F7, B2:B10) will cause an error. Always enclose operators in quotation marks.
  • Incorrectly placing quotation marks: =SUMIF(C2:C10, “> &F7”, B2:B10) won’t work. Ensure the ampersand is outside the quotes (“>”&F7).
  • Misusing absolute references: If copying formulas to multiple rows, keep references relative. If referencing a fixed value, use absolute references ($F$7).

Troubleshooting: Why Your SUMIF Formula Isn’t Working

Sometimes, your SUMIF formula may not return the expected results, leaving you frustrated. This usually happens due to incorrect data types, mismatched ranges, or syntax errors. Below are the most common issues and their solutions to help you fix your formula quickly.

SUMIF Supports Only One Condition

The SUMIF function can only handle one condition at a time. If you need to sum values based on multiple conditions, use the SUMIFS function instead. Alternatively, you can combine multiple SUMIF formulas using addition (+) to include multiple OR conditions.

Ensure Range and Sum Range Have the Same Size

For SUMIF to work properly, the range (where the condition is checked) and sum_range (the cells to be summed) must have the same number of rows and columns. If they don’t match, Excel may sum incorrect values. Always ensure both ranges are aligned in size and shape to avoid errors.

Incorrect Formula:

 SUMIF formula with mismatched column sizes

Correct Formula:

SUMIF formula with correctly matched ranges

Avoid Using Arrays in Range and Sum Range

SUMIF does not support array constants in the range and sum_range. These arguments should only contain direct cell references. If you accidentally use an array formula, SUMIF will not function correctly. Always refer to actual cell ranges instead of manually entering arrays.

Check SUMIF Criteria Syntax

Incorrectly formatted criteria can cause SUMIF to fail. Follow these rules to avoid errors:

  • Enclose text criteria in double quotes:
SUMIF formula using text criteria
  • Use quotation marks for logical operators:
 SUMIF formula with logical condition
  • Use ampersand (&) when referring to a cell:
 SUMIF formula using a cell reference

SUMIF Not Working with Another Workbook

If your SUMIF formula refers to another workbook, it will only work while it is open. If you close the workbook, the formula may return a #VALUE! error. To avoid this, keep the referenced file open or consider using alternative functions like SUMPRODUCT.

SUMIF Ignores Uppercase and Lowercase Letters

Excel’s SUMIF function is not case-sensitive, meaning “apple” and “APPLE” are treated the same. If you need a case-sensitive sum, use the SUMPRODUCT function with EXACT to differentiate between uppercase and lowercase values.

In Closing

In conclusion, mastering the SUMIF formula in Excel empowers you to handle data efficiently and confidently. This powerful function simplifies calculations and helps you analyse key metrics with ease. Understanding the syntax, troubleshooting common errors, and applying practical examples can optimise your spreadsheets and enhance your productivity. 

Every mistake becomes a learning opportunity to improve your Excel skills. You can also learn Excel and other vital data science tools by taking data science courses through Pickl.AI. Embrace continuous learning, explore advanced techniques, and unlock new career opportunities. Excel opens exciting new career opportunities.

Frequently Asked Questions 

What is the SUMIF function in Excel?

Excel’s SUMIF function efficiently sums numbers that meet a specific condition within a defined range. It checks each cell against your criteria and adds corresponding values if they match. This function streamlines calculations, making data analysis simpler by focusing on relevant figures while significantly reducing manual summing errors with ease.

How do I use SUMIF with multiple criteria?

The SUMIF function supports only one condition. To use multiple criteria, combine several SUMIF formulas with addition or use the SUMIFS function instead. SUMIFS lets you sum values that meet all specified conditions. Both methods enable complex data analysis and improve accuracy when working effectively with diverse datasets in Excel.

Why might my SUMIF formula not work correctly?

SUMIF may not work correctly due to common issues like mismatched range sizes, incorrect criteria syntax, or using arrays instead of cell ranges. Data type mismatches and closed workbook references also cause errors. Check your formula for proper syntax, matching ranges, and correct cell references to ensure consistent and accurate results.

Authors

  • Versha Rawat

    Written by:

    Reviewed by:

    I'm Versha Rawat, and I work as a Content Writer. I enjoy watching anime, movies, reading, and painting in my free time. I'm a curious person who loves learning new things.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments