Topic 02
Advanced Formulas
Move from simple calculations to conditional ones. COUNTIF and SUMIF let you ask Excel a question with a condition — count or sum only the rows that match. By the end of this topic you'll build a full staff summary and complete a two-file lab.
Step 1 — The Table Check
Open StaffData.xlsx. Before writing a single formula — do we already have a Table here?
The file contains 741 staff members. Convert it to a Table and name it staff:
Ctrl + T → confirm range → check "My table has headers" → OK.staff → Enter.Step 2 — Meet COUNTIF & SUMIF
Both functions add a condition to what you already know — count or sum only the rows that match.
Takes a range to search and a condition to match. Returns how many cells satisfy it.
staff[Building]"Al Gharrafa", or a cell reference A2 to copy the formula down.Example — count staff in Al Gharrafa (via cell reference):
Same idea as COUNTIF but adds a third argument — the column to sum when the condition is met.
staff[Building]staff[Salary]Example — total salary for the building in A2:
Step 3 — Build the Building Summary
Create a summary next to the staff data. List the 6 buildings, then use COUNTIF and SUMIF to fill in headcount and total salary for each. Enter your results below to check.
staff[Building] stay fixed automatically when copied. Only the criteria cell (A2) needs to move — no dollar signs needed on those arguments.| Building | How many | How much (salary) |
|---|---|---|
| Ain Khaled | ||
| Al Gharrafa | ||
| Doha | ||
| Duhil | ||
| Lusail | ||
| Wakra | ||
| Grand Total |