Core Functions

Excel Fundamentals

Chapter 4 · Core Functions: SUM, AVERAGE, COUNT/COUNTA, IF, and Nesting Functions

Chapter 1 previewed =SUM(A1:A10) just long enough to introduce ranges. This chapter is where functions stop being a preview and become the main event — the handful of functions covered here account for a huge share of everything a typical Excel user ever actually writes, and nesting them inside one another is how simple building blocks turn into genuinely useful logic.

What a Function Actually Is

A function is a named, pre-built calculation: a name (like SUM), followed by parentheses containing one or more arguments — the inputs the function needs to do its job — separated by commas. =A1+A2+A3 and =SUM(A1:A3) can calculate the exact same result, but the function version scales: adding 3 numbers with + is fine, adding 300 is not.

SUM — Adding a Range (or Several)

SUM adds up every numeric value in whatever you give it. A single range is the most common case, but you can pass several ranges and individual cells at once, separated by commas:

=SUM(A1:A10) → adds every value from A1 through A10 =SUM(A1:A10, C1, E1:E5) → adds A1:A10, plus C1 on its own, plus E1:E5 — all in one call

SUM silently ignores text and empty cells within its range rather than raising an error — it only adds up whatever it finds that's genuinely numeric.

AVERAGE — the Mean of a Range

=AVERAGE(B2:B8) → sums every number in B2:B8, then divides by how many numbers it found

The division is by the count of numeric values found, not by the total number of cells in the range. If B2:B8 (7 cells) contains only 5 actual numbers and 2 blank cells, AVERAGE divides by 5, not 7 — the blanks are excluded entirely rather than treated as zero. This is a common source of confusion, since it means a blank cell and a cell containing the number 0 genuinely produce different averages.

COUNT vs. COUNTA — Two Different Questions

These two functions look almost identical but answer different questions, and mixing them up produces confidently wrong results:

FunctionCountsOn a range with 5 numbers, 3 text entries, 2 blanks
COUNTOnly cells containing numbersReturns 5
COUNTAAny non-empty cell, regardless of content typeReturns 8 (5 numbers + 3 text)
=COUNT(A1:A10) → "how many numbers are in this range?" =COUNTA(A1:A10) → "how many cells in this range have anything in them at all?"

A practical rule of thumb: use COUNT when you specifically care about numeric entries (e.g. "how many students actually submitted a numeric score"), and COUNTA when you care about entries existing at all, regardless of type (e.g. "how many students entered anything, including a text note like 'absent'").

IF — Excel's Conditional Logic

IF takes three arguments: a condition to test, what to return if that condition is true, and what to return if it's false.

=IF(B2 >= 50, "Pass", "Fail") → if B2 is 50 or more, returns the text "Pass"; otherwise returns "Fail"

Any of Excel's comparison operators can be used as the condition: =, <> (not equal), >, <, >=, <=. The true/false results don't have to be text — they can be numbers, or even other formulas.

Nesting Functions Inside One Another

A single IF only distinguishes two outcomes. Real grading needs more than pass/fail — putting a second IF inside the "false" branch of the first lets you test a second condition only when the first one didn't match, building up as many bands as you need:

=IF(B2>=90, "A", IF(B2>=80, "B", IF(B2>=70, "C", "F")))

Read this from the outside in: "if B2 is 90 or above, A. Otherwise (so we already know B2 is below 90), check whether it's 80 or above — if so, B. Otherwise (below 80), check 70 or above — if so, C. Otherwise, F." Each nested IF only ever runs when every earlier condition already failed, which is exactly why the thresholds can be checked in descending order without a band overlapping the one before it.

Functions can nest into each other's arguments generally, not just IF inside IF — a SUM can be one of IF's results, an AVERAGE can be tested by a comparison, and so on. The rule is always the same: whatever the inner function returns becomes one plain value the outer function then uses, exactly as if you'd typed that value in by hand.

Reading a nested formula: work from the innermost parentheses outward
When a formula looks intimidating, find the deepest, most-nested function first and mentally resolve it to a single value, then treat that value as a plain input to the function wrapped around it, one layer at a time. This chapter's grading formula resolves cleanly if you imagine B2 as a specific number (say, 85) and trace which branch actually fires at each level, rather than trying to read all three IFs at once.
Every opening parenthesis needs a matching closing one — nesting makes this easy to get wrong
The three-level grading formula above ends in ))) — three closing parentheses, one for each IF that was opened. Excel's formula bar colour-codes matching pairs as you type to help you check this, but it's still the single most common typo in a nested formula: one parenthesis short or one too many, and Excel either shows an error or — worse — silently accepts a formula that doesn't group the way you intended.

Hands-On Exercises

Exercise 1

A1:A6 contains: 10, "N/A", 20, blank, 30, "N/A". Write the formula for =SUM(A1:A6), =AVERAGE(A1:A6), =COUNT(A1:A6), and =COUNTA(A1:A6), and state exactly what each one returns. Explain why AVERAGE's result is not simply the SUM divided by 6.

📄 View solution
Exercise 2

Write a single IF formula for cell B2 that returns "Adult" if the age in A2 is 18 or over, and "Minor" otherwise. Then write out, by hand, exactly what the formula evaluates to if A2 contains 17, and if A2 contains 18.

📄 View solution
Exercise 3

Write a nested IF formula for cell C2 that categorises a temperature in A2 into four bands: "Hot" (30 or above), "Warm" (20 up to 29.9), "Cool" (10 up to 19.9), and "Cold" (below 10). Trace through your formula by hand for A2 = 25 and explain exactly which branch fires and why the earlier ones don't.

📄 View solution

Chapter 4 Quick Reference

  • =SUM(range, ...) — adds all numeric values found; text/blanks ignored
  • =AVERAGE(range) — sums numbers found, divides by COUNT of numbers found (not total cells)
  • =COUNT(range) — counts numeric cells only
  • =COUNTA(range) — counts any non-empty cell, any type
  • =IF(condition, if_true, if_false) — the basic building block of conditional logic
  • Nesting: put a function's result anywhere another function expects a plain value — read nested formulas from the innermost parentheses outward
  • Closing parentheses must match opening ones exactly — one extra or missing is the most common nested-formula bug