← All 45 books Excel, one function per page Get the full edition · £10
One function per page

Excel, one function per page

The twenty-five functions that take you from copying formulas to writing them.


Steve Hodgkiss 8 functions

What each function does, how it bites, and one thing to try right now.

Excel, one function per page

The twenty-five functions that take you from copying formulas to writing them.


Set in Space Grotesk, Inter and JetBrains Mono (SIL Open Font License).

Syntax, arguments and defaults checked against the official Microsoft Excel function reference (support.microsoft.com).

Excel is a trademark of the Microsoft group of companies. This book is not affiliated with or endorsed by Microsoft.

Your purchase is for personal use only. You do not have redistribution rights: please do not share, resell, or republish this book or its pages.

© 2026 Steve Hodgkiss. All rights reserved. Personal use only; no redistribution rights.

Edition 1.0 · stevehodgkiss.net

Contents

Contents


Part 1 · Looking things up4
XLOOKUP5
VLOOKUP6
Part 2 · Adding it up7
SUMIF8
SUBTOTAL9
Part 3 · Logic and choices
IF10
Part 4 · Text and dates
TEXTJOIN11
Part 5 · Shaping data12
UNIQUE13
Absolute references14
Part 1 of 5
Finding the value you need
1

Looking things up

The reason most people open Excel twice a day: the number I need is in the sheet somewhere. Five machines that find it for you.


In this part
  1. 01XLOOKUP
  2. 02VLOOKUP

XLOOKUP finds what you ask for in one column and hands you back the value from the same row in another column, whichever side it sits on.

Excel · No. 01
Looking things up

XLOOKUP

The search machine that works in any direction

FIND THE ROW, HAND BACK THE VALUEInvoice 1042what you havelookup_arrayreturn_array1040£1801042£651044£921046£54Searches down one column, then returns the value from the same row of another column.

Let's say the invoice numbers live in one sheet and the amounts live in another. You want one machine: give it an invoice number, get the amount. XLOOKUP(what to find, where to search, what to give back) is that machine.

It needs Excel 2021 or Microsoft 365, and it defaults to an exact match. The columns are named separately, so it finds things in any direction. The old way gave you a bald #N/A when nothing matched; here a fourth argument returns a friendly word instead: XLOOKUP(E2, B:B, D:D, "not found").

Name the column to search and the column to return. That's the whole trick.

TRY IT NOW

Type four invoice numbers down column B and four amounts down D. In F2: =XLOOKUP(1042, B2:B5, D2:D5). Change the 1042 and watch it follow.

VLOOKUP searches the first column of a range for your value, counts across to the column number you name, and returns what it finds there.

Excel · No. 02
Looking things up

VLOOKUP

The classic lookup, and the traps it was born with

SEARCH THE FIRST COLUMN, COUNT ACROSScolumn 1column 2column 31042·1044··23£65£65foundcan'tlook leftColumn 1 is counted as 1. The value you look up must live there; answers can only sit to its right.

Let's say you inherited a sheet full of =VLOOKUP(A2, $B$2:$D$99, 3, FALSE) and you'd like to know what the parts mean. Search the first column for A2, count across to column 3, FALSE means exact only.

Three traps come free. It cannot look left: the search value must sit in the range's first column. Leave the last argument out and you get an approximate match, which quietly returns a wrong value instead of an error. And numbers pasted as text never match while looking perfect.

FALSE at the end, always, unless you can say why not. That habit removes most VLOOKUP bugs.

TRY IT NOW

Open an old table, find a VLOOKUP, check its fourth argument. Not FALSE? Test it against the row it claims to match.

Part 2 of 5
Totals that answer questions
2

Adding it up

SUM is the first function anyone learns. These are the versions that add only what matters: the region, the month, the visible rows.


In this part
  1. 01SUMIF
  2. 02SUBTOTAL

SUMIF adds only the numbers that pass one test. Same shape as SUM, but with a condition in the middle.

Excel · No. 03
Adding it up

SUMIF

The total, but only for the rows you mean

ADD ONLY THE ROWS THAT MATCH ">160000"250,000140,000300,000100,000">160000"the criteriain quotes550,000only those=SUMIF(A2:A5, ">160000", B2:B5)One range to test, the criteria, and optionally the range to actually add.

Let's say the sheet has 400 rows and the boss wants "sales over ten thousand, added up". Scrolling and Ctrl-clicking is one way. =SUMIF(A2:A400, ">10000") is the other.

The criteria is a piece of text wearing a condition: ">10000", "North", B2 all work. Comparison criteria always live in quotes; without them it's a formula error, not a filter. When the range you test and the range you add differ, the third argument is the add-range, lined up row by row.

One condition, one line, live forever. When one condition stops being enough, SUMIFS is next page.

TRY IT NOW

Put 4000, 12000, 9000, 20000 in A2:A5. In C1: =SUMIF(A2:A5, ">10000"). It says 32000. Change any number and watch it move.

SUBTOTAL is SUM, AVERAGE or COUNT with respect for your filter: rows you filtered away stop being counted.

Excel · No. 04
Adding it up

SUBTOTAL

The total that matches what you can see

THE FILTER HIDES ROWS. WHICH TOTAL STILL TELLS THE TRUTH?80607090hidden300SUM sees all80607090hidden240SUBTOTAL(109)9 includes manually hidden rows. 109 ignores them. Filtered-out rows are always excluded.

Let's say you filter to one region and the grand total keeps insisting on all four. The fix is one word: =SUBTOTAL(109, C2:C99). The total now follows the visible rows and changes as the filter changes.

The first argument is a code: 9 is SUM, 1 is AVERAGE, 2 is COUNT, 109 is SUM ignoring the rows you hid by hand too. The quiet superpower: SUBTOTAL ignores other SUBTOTALs in its range, so section totals plus a grand total never double-count.

Filtered rows never count, whichever code you pick. 101 to 111 also skip manually hidden rows.

TRY IT NOW

Four numbers in C2:C5, =SUM and =SUBTOTAL(109) under them. Hide row 3. SUM is unmoved; SUBTOTAL drops.

IF tests a condition and returns one thing when it is true and another when it is not. The sheet's fork in the road.

Excel · No. 05
Logic and choices

IF

The sheet starts making decisions

A FORK IN THE ROADB2 = 74the valueB2 >= 40?the testTRUE"Pass"value if trueFALSE"Fail"value if false=IF(B2>=40, "Pass", "Fail")One test, two answers. The formula in your sheet decides, not your eyes.

Let's say 300 scores need Pass or Fail. Reading them yourself is a Tuesday nobody needs. =IF(B2>=40, "Pass", "Fail") does the whole column once you fill it down.

Three parts, always this order: the test, the answer if true, the answer if false. Text answers wear quotes; =IF(B2>=40, Pass, Fail) breaks because Excel hunts for cells named Pass. The classic mistake is nesting IFs three deep. Past two branches, the next page is the kinder road.

The test can hold anything that returns TRUE or FALSE, including the combiners two pages ahead.

TRY IT NOW

Ten numbers in B2:B11. In C2: =IF(B2>=40, "Pass", "Fail"), double-click the fill handle. Change one score.

TEXTJOIN glues many cells into one piece of text with a separator you choose, and can skip the empty ones.

Excel · No. 06
Text and dates

TEXTJOIN

A column of values becomes one clean cell

MANY CELLS IN, ONE POLITE SENTENCE OUTLondonParisBerlin", " + TRUEdelimiter + skip emptiesthe comma pumpLondon, Paris, Berlinone cell, no gaps=TEXTJOIN(", ", TRUE, A2:A5)The empty cell dropped through the grate. CONCAT glues too, but it has no delimiter and no skip.

Let's say fifty cities in a column need to become one line for an email. Copy, paste, type a comma, sigh, repeat. =TEXTJOIN(", ", TRUE, A2:A50) does the whole column in one cell.

The second argument is the quiet hero: TRUE skips empty cells, so gaps don't become double commas. FALSE and every blank rides through. The older CONCAT still works, but it has no delimiter argument, so the commas would all be yours.

Excel 2019 or 365. Any text works as the delimiter; a line break is CHAR(10) plus Wrap Text.

TRY IT NOW

Four words in A2:A5, leave A4 empty. =TEXTJOIN(", ", TRUE, A2:A5) gives three words. Flip TRUE to FALSE and meet the double comma.

Part 5 of 5
From raw to organised
5

Shaping data

The habits that separate a pile of cells from a report: live sorts, distinct lists, a pivot you can build by hand, and the fences that keep bad data out.


In this part
  1. 01UNIQUE
  2. 02Absolute references

UNIQUE returns each different value in a range once: a live de-duplicated list that updates as the data does.

Excel · No. 07
Shaping data

UNIQUE

The distinct list, one formula, no Remove Duplicates

EVERY VALUE ONCE. NO MORE THAN ONCE.NorthSouthNorthEastUNIQUE(A2:A50)first of each survivesNorthSouthEastexactly_once=TRUE keeps only the once-only valuesExcel 2021 or 365. A de-duplicated list, live. Feed it straight into COUNTIFS as the row of headings.

Let's say you need the list of regions that actually appear in the data. Remove Duplicates is a one-way edit. =UNIQUE(A2:A500) is a live answer that grows a new region the moment a row needs one. Excel 2021 or 365.

Its real job here is feeding COUNTIFS: UNIQUE gives the headings, COUNTIFS fills the counts, and two pages on they build a pivot together. The optional third argument is the connoisseur's tool: exactly_once TRUE keeps only values appearing a single time, perfect for finding one-offs.

Pass a multi-column range and uniqueness is judged on whole rows, which is usually what you meant.

TRY IT NOW

Eight rows of Region with repeats. In C2: =UNIQUE(A2:A9). Add a new region to the data and watch the list extend itself.

Absolute references put dollar signs in front of what must not move. Copy the formula anywhere and $F$1 still points at exactly F1.

Excel · No. 08
Shaping data

Absolute references

One rate cell, a hundred formulas, all reading it

THE DOLLAR SIGNS THAT PIN A CELL IN PLACEG2: =E2*$F$1G3: =E3*$F$1G4: =E4*$F$1$F$1pinned: same for every rowE2 un-pinnedbecomes E3, E4...filldrag downF4 flips a reference through $F$1, F$1, $F1, F1. The rate cell must read F1 from every row: $F$1.

Let's say VAT needs applying to a hundred rows and the rate sits in F1. Type =E2*F1 and fill down: row 3 reads F2, empty. References move because moving is what references do. Pin it: =E2*$F$1, and every row reads the one true cell.

Read the dollars as bolts: $F$1 bolts column and row, F$1 pins the row, $F1 the column. The F4 key cycles a selected reference through all four. The pivot thought leaned on exactly this: data pinned, heading free.

Change the rate once and the whole sheet reprices. That is a spreadsheet working as designed.

TRY IT NOW

Rate 0.2 in F1, amounts in E2:E4. In G2: =E2*F1, fill down, watch the zeros. Edit to =E2*$F$1, fill down, see it hold.

Index

Index


Absolute references14
IF10
SUBTOTAL9
SUMIF8
TEXTJOIN11
UNIQUE13
VLOOKUP6
XLOOKUP5