How to Use SUMIF & SUMIFS in Excel | Excel Analytics Series Part 5

 

Introduction

Imagine you're reviewing a monthly sales report with thousands of records. Your manager asks a simple question:

"What is the total sales amount for the Karachi branch?"

You could filter the data and calculate it manually, but that approach becomes slow and inefficient as your dataset grows.

This is exactly where SUMIF and SUMIFS become valuable.

These Excel functions allow you to add numbers based on specific conditions. Instead of summing an entire column, you can calculate totals that match your criteria, such as a particular city, product, employee, department, or date range.

Whether you're preparing MIS reports, managing inventory, tracking expenses, or analyzing sales, SUMIF and SUMIFS can save time while improving accuracy.

In this guide, you'll learn what these functions do, how they differ, when to use each one, and how they are applied in real business scenarios.


What Is the SUMIF Function?

The SUMIF function adds values that meet one condition.

For example, you can calculate:

  • Total sales for one branch
  • Total expenses for one category
  • Total orders from one customer
  • Total salary for one department

Instead of adding every value manually, Excel performs the calculation automatically.


SUMIF Syntax

=SUMIF(range, criteria, sum_range)

Understanding the Arguments

Range

The cells Excel checks for the condition.

Criteria

The condition you want Excel to match.

Sum_range

The cells that contain the values to be added.


Example 1: Calculate Sales for One City

Suppose your worksheet contains the following information.

CitySales
Karachi52000
Lahore41000
Karachi38000
Islamabad46000
Karachi27000

Formula:

=SUMIF(A2:A6,"Karachi",B2:B6)

Result:

117000

Excel adds only the sales belonging to Karachi.


Example 2: Total Sales Above a Certain Amount

You can also use comparison operators.

Formula:

=SUMIF(B2:B10,">50000")

Excel adds every value greater than 50,000.


What Is the SUMIFS Function?

The SUMIFS function works like SUMIF, but it supports multiple conditions.

Use it whenever your calculation depends on more than one requirement.

For example:

  • Sales from the Karachi branch and the Electronics category
  • Orders placed in June and marked as Completed
  • Expenses for the HR department and above a certain amount

SUMIFS Syntax

=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2)

Unlike SUMIF, the sum range comes first.


Example 3: Sales by City and Product

CityProductSales
KarachiLaptop85000
KarachiMobile62000
LahoreLaptop71000
KarachiLaptop47000

Formula:

=SUMIFS(C2:C5,A2:A5,"Karachi",B2:B5,"Laptop")

Result:

132000

Excel adds only the Laptop sales from Karachi.


SUMIF vs SUMIFS

SUMIFSUMIFS
Works with one conditionWorks with multiple conditions
Easy to useMore flexible
Suitable for simple reportsBest for advanced reporting
Shorter formulaLonger formula

Choose SUMIF when you have a single condition.

Choose SUMIFS when your report requires multiple conditions.


Real-Life Business Applications

These functions are commonly used in workplaces for:

Sales Reporting

Calculate sales by city, salesperson, or product.

HR Reporting

Find total salaries by department or designation.

Finance

Calculate expenses by category, vendor, or month.

Inventory Management

Total stock received from a particular supplier.

Customer Analysis

Calculate purchases made by a specific customer.

MIS Dashboards

Display dynamic totals based on selected filters.


Common Mistakes to Avoid

Using Different Range Sizes

Every criteria range and sum range should contain the same number of rows.

Incorrect ranges often return unexpected results.


Typing the Wrong Criteria

Even a small spelling mistake can change the result.

Always double-check names, categories, and codes.


Forgetting Quotation Marks

Text conditions must be written inside quotation marks.

Correct:

=SUMIF(A2:A10,"Karachi",B2:B10)

Incorrect:

=SUMIF(A2:A10,Karachi,B2:B10)

Tips for Better Results

  • Keep your data clean and consistent.
  • Avoid unnecessary spaces in text values.
  • Convert your data into an Excel Table for easier management.
  • Use cell references instead of typing criteria directly whenever possible.
  • Review your formulas after copying them to other cells.

Practice Exercise

Create a worksheet containing:

  • Branch
  • Product
  • Sales

Now answer these questions using SUMIF or SUMIFS:

  1. What are the total sales for Karachi?
  2. What are the total Laptop sales?
  3. What are the total Mobile sales in Lahore?
  4. Which branch generated the highest total sales?

Practicing with your own data is one of the best ways to understand these functions.


Frequently Asked Questions

1. What is the difference between SUMIF and SUMIFS?

SUMIF works with one condition, while SUMIFS supports multiple conditions in the same formula.

2. Can SUMIFS use numbers and text together?

Yes. You can combine text, numbers, dates, and comparison operators in one formula.

3. Which function should beginners learn first?

Start with SUMIF because it introduces the basic concept of conditional calculations. Once you're comfortable with it, learning SUMIFS becomes much easier.

4. Are SUMIF and SUMIFS available in all Excel versions?

Yes. They are available in most modern versions of Microsoft Excel.

5. Where are these functions used professionally?

They are widely used in finance, accounting, HR, sales analysis, inventory management, administration, and MIS reporting.


Conclusion

SUMIF and SUMIFS are practical tools that help you calculate totals based on specific conditions without filtering or manually adding values.

As your datasets grow, these functions become increasingly useful for preparing accurate reports, analyzing business performance, and making better decisions.

Spend some time practicing with different scenarios, and you'll soon discover how much faster your reporting process becomes.

In Part 6 of the Excel Analytics Series, we'll explore COUNTIF and COUNTIFS, where you'll learn how to count records that match one or multiple conditions instead of calculating totals.
Keep practicing, keep growing!

Auto Refresh and Link Loop

Comments