When managing sales data in Excel, calculating total values by condition is a regular need. With the SUM and SUMIF functions, you can quickly total your sales — either generally or based on specific criteria like Department or State.
Let’s explore how both work using a simple dataset.
Table of Contents
📊 Sample Data:
| Name | State | Department | Sales (INR) |
|---|---|---|---|
| Ankit | Delhi | Electronic | 15,000 |
| Meera | Delhi | Fashion | 12,000 |
| Rohan | Punjab | Grocery | 8,500 |
| Neha | Delhi | Home & Living | 9,000 |
| Suresh | Gujarat | Sports | 11,200 |
| Pooja | Delhi | Beauty | 10,500 |
🔹 1. Using the SUM Function (Basic Total)
If you want to simply calculate the total sales, use SUM.
Formula:
=SUM(D2:D7)
📌 What it does: Adds up all values in the Sales column (D2 to D7).
🔸 2. Using the SUMIF Function (Condition-Based Total)
✅ Use Case 1: Total Sales for Department = Electronic
Formula:
=SUMIF(C2:C7, "Electronic", D2:D7)
📌 Explanation:
- C2:C7 → Range where condition is checked (Department)
- “Electronic” → Criteria
- D2:D7 → Sales values to sum if condition matches
🧾 Result: 15,000
✅ Use Case 2: Total Sales for State = Delhi and Department = Fashion
For multiple conditions, we use SUMIFS.
Formula:
=SUMIFS(D2:D7, B2:B7, "Delhi", C2:C7, "Fashion")
📌 Explanation:
- D2:D7 → Sales values to sum
- B2:B7, “Delhi” → Match Delhi in the State column
- C2:C7, “Fashion” → Match Fashion in the Department column
🧾 Result: 12,000
📌 Key Differences – SUM vs SUMIF vs SUMIFS
| Function | Use Case | Supports Multiple Conditions |
|---|---|---|
SUM | Total of a numeric range | ❌ |
SUMIF | Total based on one condition | ❌ |
SUMIFS | Total based on multiple filters | ✅ |
🎯 Final Thoughts:
Excel makes sales analysis quick and insightful when you know how to use the right formula:
- ✅ Use
SUMfor simple totals - ✅ Use
SUMIFfor one condition - ✅ Use
SUMIFSfor complex, multi-condition filters