Know and understand the difference between a formula and a function

20 Spreadsheets – Formula vs Function (Cambridge IGCSE ICT 0417)

0. Syllabus Topic‑Map (Section 20 & Related Sections)

SectionTitle (Cambridge ICT Syllabus)Status
1Hardware✓ Notes ready
2Software✓ Notes ready
3Input & Output Devices✓ Notes ready
4Networks✓ Notes ready
5Effects of IT on Individuals & Society✓ Notes ready
6ICT Applications✓ Notes ready
7Systems Life‑Cycle✓ Notes ready
8Safety & Security (e‑safety)✓ Notes ready
9Communication & Collaboration✓ Notes ready
10File Management✓ Notes ready
11Images – Formats & Editing✓ Notes ready
12Word Processing – Layout, Styles, Proofing✓ Notes ready
13Spreadsheets – Data Entry, Formatting, Charts✓ Notes ready
14Spreadsheets – Formulas & Functions (this note)✓ Updated
15Spreadsheets – Data Analysis (sorting, filtering, pivot tables)✓ Notes ready
16Databases – Tables, Queries, Forms, Reports✓ Notes ready
17Presentation Software – Slides, Animation, Audio/Video✓ Notes ready
18Website Authoring – HTML, CSS, Publishing✓ Notes ready
19Project Work – Planning, Evaluation, Documentation✓ Notes ready
20Spreadsheets – Formulas & Functions (focus of this note)✓ Updated
21Exam Techniques & Assessment Objectives (AO1‑AO3)✓ Notes ready

1. What Is a Formula?

  • A formula is any expression that the spreadsheet evaluates to produce a result.
  • All formulas start with an equals sign =.
  • Typical components that may appear in a formula:
    • Cell references – relative (A1), absolute ($A$1), or mixed (A$1, $A1).
    • Constants – numbers (e.g., 100) or text strings (e.g., "Pass").
    • Arithmetic operators+, -, *, /, ^ (exponent).
    • Parentheses – control the order of evaluation.
  • Order of operations (PEMDAS/BODMAS) used by the spreadsheet:
    1. Parentheses
    2. Exponents
    3. Multiplication and division – evaluated left‑to‑right
    4. Addition and subtraction – evaluated left‑to‑right

    Example: =A1 + B1 * 2 is interpreted as A1 + (B1 × 2).

  • Common pitfalls to watch for:
    • Implicit conversion – adding a number to a text string returns #VALUE! unless the text can be coerced.
    • Division by zero produces #DIV/0!.
    • Circular references cause #REF! or a warning dialog.
    • Forgotten absolute references when copying formulas can lead to incorrect results.

2. What Is a Function?

A function is a predefined calculation supplied by the spreadsheet program. Its syntax is:

=FUNCTION_NAME(argument1, argument2, …)

Functions save time, reduce errors and often include built‑in error handling.

Function Purpose (one‑sentence description) Typical syntax
SUMAdds all numbers in a range.=SUM(A1:A5)
AVERAGEReturns the arithmetic mean of a range.=AVERAGE(B1:B10)
COUNTCounts numeric entries in a range.=COUNT(C1:C20)
COUNTACounts all non‑blank cells (numbers, text, logical values).=COUNTA(D1:D20)
COUNTIFCounts cells that meet a single condition.=COUNTIF(E1:E15,">50")
COUNTIFSCounts cells that meet multiple conditions.=COUNTIFS(F1:F10,">0",G1:G10,"<=100")
SUMIFAdds cells that meet a single condition.=SUMIF(H1:H10,">0")
SUMIFSAdds cells that meet multiple conditions.=SUMIFS(I1:I10,J1:J10,">0",K1:K10,"<=100")
AVERAGEIFCalculates the mean of cells that meet a condition.=AVERAGEIF(L1:L20,">=75")
IFReturns one value if a condition is true, another if false.=IF(M2>50,"Pass","Fail")
ANDReturns TRUE only if all arguments are TRUE.=AND(N2>0,P2<100)
ORReturns TRUE if any argument is TRUE.=OR(Q2="Yes",R2="Y")
NOTReverses a logical value.=NOT(S2)
IFERRORReturns a specified value when a formula results in an error.=IFERROR(T2/U2,0)
LOOKUPSearches a one‑dimensional range for a value and returns a corresponding value.=LOOKUP(V2,A1:A10,B1:B10)
VLOOKUPVertical lookup – finds a value in the first column of a table.=VLOOKUP(W2,Table!A:D,3,FALSE)
HLOOKUPHorizontal lookup – searches across the top row of a table.=HLOOKUP(X2,Table!A1:D4,2,FALSE)
XLOOKUPModern lookup – flexible search direction with default exact match.=XLOOKUP(Y2,A:A,B:B,"Not found")
INDEXReturns the value of a cell in a given row and column of a range.=INDEX(Z1:Z10,5)
MATCHReturns the position of a lookup value in a range.=MATCH(AA2,AA1:AA20,0)
DATECreates a date from year, month, day.=DATE(2026,1,4)
TIMECreates a time from hour, minute, second.=TIME(14,30,0)
TODAYReturns the current date (no time).=TODAY()
NOWReturns the current date and time.=NOW()
POWERRaises a number to a power.=POWER(2,3)
SQRTReturns the square root.=SQRT(16)
ROUNDRounds to a specified number of decimal places.=ROUND(AB2,2)
ROUNDUPRounds away from zero.=ROUNDUP(AC2,0)
ROUNDDOWNRounds towards zero.=ROUNDDOWN(AD2,0)
CONCAT (or CONCATENATE)Joins two or more text strings.=CONCAT(AE2," ",AF2)
TEXTJOINJoins a range of text strings with a delimiter, optionally ignoring blanks.=TEXTJOIN(", ",TRUE,AG2:AG5)
LEFTReturns the leftmost characters of a text string.=LEFT(AH2,3)
RIGHTReturns the rightmost characters of a text string.=RIGHT(AI2,2)
MIDReturns a specific number of characters from the middle of a text string.=MID(AJ2,2,4)
LENReturns the length of a text string.=LEN(AK2)
TRIMRemoves extra spaces from a text string.=TRIM(AL2)
TEXTFormats a number or date as text.=TEXT(AM2,"0.00%")

Analysis / Evaluation tip (AO3): When choosing a lookup function, consider accuracy (exact vs approximate match), maintainability (XLOOKUP can replace both VLOOKUP and HLOOKUP), and performance (XLOOKUP is generally faster on large tables).

3. Using Functions Inside Formulas (Nested Functions)

Functions can be combined, or placed inside a larger arithmetic expression, to create powerful calculations.

=IFERROR(VLOOKUP(A2,ProductTable,3,FALSE),0)
  • VLOOKUP searches for the product code in ProductTable and returns the sales figure from column 3.
  • IFERROR replaces the #N/A error (product not found) with 0.

Another example – calculate the average of only positive numbers in a range:

=AVERAGEIF(B1:B20,">0")

4. Named Cells / Named Ranges

  • Definition: Assign a meaningful name to a single cell or a block of cells (e.g., TaxRate for $B$1).
  • How to create (typical steps):
    1. Select the cell or range.
    2. Click in the Name Box (left of the formula bar), type the desired name (no spaces, start with a letter), and press Enter.
  • Benefits:
    • Formulas become easier to read: =Price * TaxRate vs =C2*$B$1.
    • When the referenced cell moves, the name automatically follows.
    • Names can be used across worksheets in the same workbook.

5. Key Differences Between Formulas and Functions

AspectFormulaFunction
OriginWritten entirely by the user.Built‑in by the spreadsheet program.
SyntaxUses operators directly (+, -, *, /, ^).Requires a name and parentheses with arguments.
ComplexityHighly flexible; can express any custom logic.Encapsulates common calculations, reducing error risk.
Re‑usabilityUsually copied or edited for each new location.Can be inserted unchanged anywhere the same data type is required.
Error handlingRelies on the user to anticipate errors.Many functions (IF, IFERROR, ISERROR) provide built‑in checks.
Evaluation speedDepends on the length of the expression.Optimised internally; functions like XLOOKUP are faster than equivalent manual formulas.

6. Practical Spreadsheet Skills Checklist (Paper 2 & 3)

  • Enter data accurately, using appropriate data types (numbers, dates, text).
  • Apply cell formatting (number formats, alignment, borders) to improve readability.
  • Create and use named ranges for key constants.
  • Write at least three different formulas that combine arithmetic operators and cell references.
  • Use a minimum of five different functions, including at least one lookup, one conditional, and one aggregation function.
  • Demonstrate nesting by embedding one function inside another (e.g., IFERROR(VLOOKUP(...),0)).
  • Apply absolute, relative, and mixed references correctly when copying formulas.
  • Sort data and apply a filter to display a subset of rows.
  • Insert a chart that automatically updates when the source data changes.
  • Protect a worksheet or specific cells to prevent accidental editing (optional – AO2).

7. Decision Flow – When to Use a Formula or a Function

Decision flowchart: Do you need a standard calculation? → Yes → Use Function; No → Use Formula
Use a function for standard calculations (SUM, AVERAGE, LOOKUP, etc.). Use a formula when the required logic is unique or when you need to combine several functions.

8. Quick Reference Cheat‑Sheet

TopicKey pointExample
Absolute referenceLock both column and row with $=$A$1
Mixed referenceLock either column or rowA$1 or $A1
Order of operationsUse parentheses to control calculation=(A1+B1)*C1
Named rangeImproves readability=Price*TaxRate
Nested functionCombine functions for robust logic=IFERROR(VLOOKUP(A2,Table,2,FALSE),0)
Conditional aggregationSUMIF/SUMIFS adds only cells meeting criteria=SUMIFS(D:D,A:A,"East",B:B,">1000")
Lookup choicePrefer XLOOKUP for flexibility and exact match=XLOOKUP(F2,Products!A:A,Products!B:B,"Not found")

Create an account or Login to take a Quiz

81 views
0 improvement suggestions

Log in to suggest improvements to this note.