Sub topic 15
Putting It Together: A Summary Table Driven by Criteria Cells
Assume you already know how to enter formulas and use ranges such as A2:A100. This walkthrough assumes a data table with these columns:
| Column | Meaning |
|---|---|
| A | Region |
| B | Product |
| C | Date |
| D | Units |
| E | Revenue |
A summary table turns criteria stored in cells into reusable calculations. Instead of editing a formula for every region, place a region name in a criteria cell and refer to that cell.
Build the summary table
In G1:J1, enter these headings:
| G | H | I | J |
|---|---|---|---|
| Region | Order count | Revenue | Average revenue |
Enter region names such as West, East, and Central in G2:G4. Then use these formulas in row 2:
=COUNTIFS($A$2:$A$100, G2)=SUMIFS($E$2:$E$100, $A$2:$A$100, G2)=IFERROR(AVERAGEIFS($E$2:$E$100, $A$2:$A$100, G2), "No matches")Copy the formulas down through row 4. The dollar signs make the data ranges absolute. They stay fixed when you fill the formulas down. G2 remains relative, so it changes to G3 and G4.
The formulas produce one count, total, and average for each region:
| Region | Order count | Revenue | Average revenue |
|---|---|---|---|
| West | 18 | 24500 | 1361.11 |
| East | 22 | 31800 | 1445.45 |
| Central | 0 | 0 | No matches |
The exact numbers depend on your data. AVERAGEIFS returns #DIV/0! when no rows match because it has no values to average. IFERROR replaces that error with readable text.
Add conditions to the summary
You can add criteria cells for a second condition. For example, put a minimum unit value in H1, or use another clearly labeled input cell such as K1. To average revenue for the selected region when units are at least the threshold in K1, use:
=IFERROR(AVERAGEIFS($E$2:$E$100, $A$2:$A$100, G2, $D$2:$D$100, ">="&$K$1), "No matches")The & joins the comparison operator to the value in K1. Every criteria pair must be true, so this formula uses AND logic: the row must belong to the region in G2 and meet the unit threshold.
Check common problems
If the summary shows an error, check these points:
- The criteria cell contains the expected text, including spaces.
- The ranges have the same number of rows.
- Revenue and units are stored as numbers, not text.
- Dates are real date values when date criteria are involved.
- Absolute references use
$so filling down does not shift the source ranges.
Exercise
Write a formula in H2 that counts rows for the region in G2 with at least 10 units.
Show answer
=COUNTIFS($A$2:$A$100, G2, $D$2:$D$100, ">=10")