Chapter 02 · basic · 6 min
Your first formula: =, references, and SUM
Every formula in Excel starts with one character: =. Skip it and Excel just stores whatever you typed as plain text — no calculation, no error, nothing. This single rule trips up more beginners than any function does, and it's the exact rule this site's grader enforces on every formula you'll ever submit here.
We'll track five orders for a small stall at a pasar malam throughout this chapter: column A is the item, column B the amount sold in ringgit.
The grid
A sales column: five order amounts (RM) in B1:B5.
= is the whole trick
Type 12 into a cell and it's just the number 12, sitting there. Type =12 and it's still just 12 — but now it's a formula Excel evaluated, not text it stored. The difference only shows up once you add a calculation:
=2+3computes to 5. Drop the = and 2+3 is three characters of text that Excel won't touch. Every function, every reference, every calculation you'll ever write lives behind that one leading character.
Before you run it — what does =2+3 evaluate to?
Scroll to see all 7 columns →
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Nasi lemak | 12 | =2+3 | ||||
| 2 | Teh tarik | 3.5 | |||||
| 3 | Roti canai | 8 | |||||
| 4 | Nasi lemak | 12 | |||||
| 5 | Teh tarik | N/A |
A reference turns a number into a rule
=12+3.5 gets you an answer for right now. =B1+B2 gets you a rule: add whatever's in B1 to whatever's in B2, forever, even after those values change. A formula with numbers typed straight into it is a receipt — accurate the moment you write it, wrong the moment the data moves. A formula that references cells is a rule that stays correct on its own.
B1 is 12, B2 is 3.5. What does =B1+B2 return — and will it still be right if B1's price changes later?
Scroll to see all 7 columns →
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Nasi lemak | 12 | =B1+B2 | ||||
| 2 | Teh tarik | 3.5 | |||||
| 3 | Roti canai | 8 | |||||
| 4 | Nasi lemak | 12 | |||||
| 5 | Teh tarik | N/A |
SUM and the range operator
Adding five cells by hand with + works, but it doesn't scale and it doesn't stay correct. SUM takes a range — B1:B5 means "every cell from B1 to B5" — and adds all of it in one call:
=SUM(B1:B5)The part that actually matters isn't that it's shorter to type — it's what happens when the data grows. Insert a sixth order between rows 3 and 4 and SUM(B1:B6) — or even SUM(B1:B5) referencing the same block — keeps working, because Excel grows the range with the sheet. A chain of =B1+B2+B3+B4+B5 doesn't: it just quietly ignores the new row, and nothing tells you it's now wrong.
B5 holds "N/A", not a number. Does SUM error out, or does it just add up the four cells that actually are numbers?
Scroll to see all 7 columns →
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Nasi lemak | 12 | =SUM(B1:B5) | ||||
| 2 | Teh tarik | 3.5 | |||||
| 3 | Roti canai | 8 | |||||
| 4 | Nasi lemak | 12 | |||||
| 5 | Teh tarik | N/A |
COUNT vs COUNTA: the trap in that N/A cell
Row 5's amount is "N/A" — someone typed that instead of leaving the cell blank or fixing the missing price. COUNT only counts cells holding an actual number; COUNTA counts any cell that isn't blank, number or not:
=COUNT(B1:B5)This matters because COUNT silently disagrees with "how many orders are there" the moment even one amount gets typed as text — it'll report 4 orders when there are genuinely 5 rows of data. That's the same failure mode SUM just had: no error, no red cell, just a number that's quietly short. COUNTA(B1:B5) would return 5 here — every cell is filled, COUNT only cares whether it's a number. A later chapter's VALUE function is exactly how you fix a column stuck like this.
How many orders have a numeric amount
In H1, count how many of the 5 rows actually have a usable numeric amount — not just how many rows exist.
Scroll to see all 7 columns →
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Nasi lemak | 12 | |||||
| 2 | Teh tarik | 3.5 | |||||
| 3 | Roti canai | 8 | |||||
| 4 | Nasi lemak | 12 | |||||
| 5 | Teh tarik | N/A |
That's the whole foundation: = starts a formula, references make it a rule instead of a receipt, and SUM/COUNT/COUNTA are the first functions everything later in this track builds on top of. Next: what happens to a reference like B1 when you copy the formula somewhere else — and the one character that stops it from moving.