Sub topic 1
Why conditional totals matter
Prerequisites
This chapter assumes you can already do the following:
- Enter and copy formulas in Excel.
- Tell relative references (
D2) from absolute references ($D$2). - Use
SUM,COUNT, andAVERAGEon a range. - Lay out data in rows and columns with a header row.
Where plain totals fall short
SUM, COUNT, and AVERAGE work on every cell in the range you give them. Real questions usually have a condition attached:
- What were total sales in the West region?
- How many laptop orders did we take?
- What is the average order value for East?
You could answer these by filtering the data and reading a status bar. That result is a one-off number, and it does not update when the data changes. A formula that applies the condition on its own stays correct as rows change, and you can place it in a report.
What conditional aggregation means
Conditional aggregation means summing, counting, or averaging only the rows that meet one or more conditions. Excel has one function for each operation:
| Function | Question it answers | Returns |
|---|---|---|
| `SUMIFS` | How much in total? | Sum of matching values |
| `COUNTIFS` | How many rows? | Count of matching rows |
| `AVERAGEIFS` | What is the typical value? | Mean of matching values |
The trailing S means each function accepts several conditions. A row is included only if it passes all of them.
The sample data
Later chapters use this layout. Headers are in row 1, and data runs from row 2 to row 100. Only the first rows are shown here.
A: Date B: Region C: Product D: Amount E: Notes
2025-01-05 West Laptop 1200
2025-01-09 East Monitor 300 Backorder
2025-02-02 West Monitor 310
2025-02-14 North Laptop 1150 GiftA first look
This formula totals the Amount column, but only for rows where Region is West:
=SUMIFS(D2:D100, B2:B100, "West")If the sheet held only the four rows above, the result would be 1510, which is 1200 plus 310. You do not need to understand every argument yet. The next chapter covers how these functions are built. For now, note that the formula names one range to add and one range to test.
How the functions decide
Each function checks every row against your conditions. It keeps the rows that pass and then applies its operation to them.
What you will build
By the end of the tutorial you will write criteria using operators, wildcards, dates, and blanks. You will also combine conditions, handle errors, and build a summary table that you can copy across and down. The last chapter covers when a PivotTable or SUMPRODUCT is the better choice.
Exercise
Using the sample data, which function would you use to find how many rows have Region equal to East, and why not SUMIFS?
Show answer
Use COUNTIFS. It counts matching rows. SUMIFS adds up values from a range, so it answers a different question: the total Amount for East, not the number of East rows.