Microsoft Excel 2024 Comprehensive Course — Beginner to Intermediate
X
Excel 2024 Microsoft 365
📗 34 Modules Foundations Data Entry Formatting Formulas Functions Charts Pivot Tables Data Analysis Protection Automation

% Module 16: Percentage & ID Number Calculations

Percentages appear in virtually every South African business spreadsheet — VAT calculations, salary increases, commission rates, discount pricing, budget variances, and growth rates. Getting percentage arithmetic right requires understanding how Excel stores percentages internally. This module also covers extracting and validating data from South African ID numbers — a critical skill for HR departments, payroll administrators, and compliance teams who need to derive birth dates, gender, citizenship status, and age automatically from the 13-digit SA ID number format.

16.1 How Excel Stores Percentages

This is the single most important concept for percentage calculations in Excel. When you apply a Percentage format to a cell, Excel does not change the stored value — it only changes the display. The number 0.15 displayed with Percentage format shows as 15%. The number 15 displayed with Percentage format shows as 1500%.

The Two Ways to Enter a Percentage

MethodYou TypeExcel StoresFormatted Display
Type the decimal (recommended) 0.15 then apply % format 0.15 15%
Type with % sign 15% 0.15 (Excel divides by 100 automatically) 15%
❌ Common mistake 15 then apply % format 15 1500% — WRONG!
The Golden Rule: In Excel, percentages are stored as their decimal equivalent. 15% = 0.15, 7.5% = 0.075, 100% = 1, 150% = 1.5. When using a percentage in a formula, you can write 15% (Excel converts it) or 0.15 — both are identical.

Checking the Stored Value

  • Click a cell showing a percentage → look at the Formula Bar — it shows the stored decimal (0.15 for 15%)
  • Press Ctrl+Shift+~ (General format) to see the raw stored value without formatting

16.2 Basic Percentage Calculations

Calculating a Percentage of a Value

TaskFormulaExample (Price = R500)
15% of a value (e.g., VAT)=A2*15%  or  =A2*0.15R75
Using a rate in a cell (e.g., B1 = 15%)=A2*B1R75 (B1 already stores 0.15)
Add 15% to a value (price incl. VAT)=A2*(1+15%)  or  =A2*1.15R575
Subtract 15% from a value (discount)=A2*(1-15%)  or  =A2*0.85R425
What is X% of total?=A2/SUM($A$2:$A$10) — format as %Each value as % of total

Back-Calculating VAT (Extracting VAT from an Inclusive Price)

Price inclusive of 15% VAT in A2 = R575

VAT amount:             =A2-(A2/1.15)    → R75
                        or: =A2*15/115   → R75
Price excl. VAT:         =A2/1.15        → R500
Verify:                  =A2/1.15*1.15  → R575 (should equal A2)

16.3 Percentage Change (Increase & Decrease)

Percentage change tells you by how much a value has changed relative to the original. It is used for growth rates, salary increases, price changes, and budget variances.

The Percentage Change Formula

Percentage Change = (New Value − Old Value) ÷ Old Value

In Excel: =(B2-A2)/A2   (format the result as %)
          or: =B2/A2-1   (equivalent, often faster to type)

Percentage Change Examples

ScenarioOld Value (A2)New Value (B2)FormulaResult
Salary increaseR25,000R27,500=(B2-A2)/A210%
Price decrease (discount)R1,200R999=(B2-A2)/A2−16.75%
Revenue growthR850,000R1,020,000=B2/A2-120%

Applying a Percentage Increase to a Value

Original salary in A2 = R25,000     Increase rate in B2 = 10%

New salary:      =A2*(1+B2) → R27,500
Increase amount: =A2*B2 → R2,500
                 or: =A2*(1+B2)-A2 → R2,500 (same result)

Handling Division by Zero in Percentage Change

If the old value is zero, the percentage change formula returns #DIV/0!. Protect against this:

=IF(A2=0,"N/A",(B2-A2)/A2)
or: =IFERROR((B2-A2)/A2,"N/A")

16.4 Budget Variances & Performance Percentages

Variance analysis compares actual values to budgeted or target values. It is a core skill for management accountants and financial analysts in SA organisations.

Variance Formulas

CalculationFormulaNotes
Rand variance (Actual − Budget)=C2-B2Positive = over budget for costs; Negative = under budget
Percentage variance=(C2-B2)/B2 formatted as %How far over/under budget as a percentage of budget
% of target achieved=C2/B2 formatted as %120% = exceeded target by 20%; 80% = 20% short of target
Favourable/Unfavourable flag=IF(C2>B2,"FAV","UNF")For revenue: exceeding budget is favourable. For costs, it is reversed.

Percentage Contribution (Share of Total)

Region sales in B2:B6, total in B7:

Each region's % of total (copy down): =B2/$B$7   (format as %)

Key: The $B$7 absolute reference ensures the denominator
(total) does not shift when the formula is copied down.

Running Percentage Totals (Cumulative %)

In C2: =SUM($B$2:B2)/$B$7  — cumulative % from row 2 to current row
In C3: =SUM($B$2:B3)/$B$7  — expands the SUM as you copy down

The mixed reference $B$2:B2 (first cell locked, second cell relative)
is the key to cumulative running totals.

16.5 Compound Growth & Interest Rate Calculations

Compound Growth Formula

Future Value = Present Value × (1 + rate)^periods

=PV*(1+rate)^n     — where PV = present value, rate = growth rate per period, n = number of periods
ScenarioFormulaExample
Investment growth=A2*(1+B2)^C2R10,000 at 8% for 5 years = R14,693.28
Salary projection (annual increase)=StartSalary*(1+AnnualIncrease)^YearsR30,000 at 6% for 3 years = R35,730.05
CAGR (Compound Annual Growth Rate)=(B2/A2)^(1/C2)-1 formatted as %R10,000 grew to R18,000 in 8 years: CAGR = 7.63%
Monthly compounding (annual rate)=PV*(1+AnnualRate/12)^(Years*12)R10,000 at 8% p.a. monthly for 5 years = R14,898.46

Using Excel's Financial Functions

=FV(rate, nper, pmt, [pv])  — Future Value
=FV(8%/12, 5*12, 0, -10000) → R14,898.46 (monthly compounding)

=PV(rate, nper, pmt, [fv])  — Present Value
=PV(8%/12, 5*12, 0, 14898) → −R10,000 (what you need to invest today)

16.6 The South African ID Number Format

South African ID numbers are 13 digits that encode significant personal information. Understanding the structure allows you to extract birth dates, determine gender, identify citizenship status, and validate the number using the Luhn algorithm — all automatically in Excel.

The 13-Digit Structure

Position:  1  2  3  4  5  6  7  8  9  10 11 12 13
Example:   9  0  0  1  1  5  5  0  0  9   0  8  7

[YYMMDD] [GGGGG] [C] [A] [Z]

YY    = Year of birth (2 digits)      — digits 1–2
MM    = Month of birth (01–12)    — digits 3–4
DD    = Day of birth (01–31)     — digits 5–6
GGGGG = Gender sequence (0000–4999 = Female, 5000–9999 = Male) — digits 7–10
C     = Citizenship (0 = SA citizen, 1 = Permanent resident) — digit 11
A     = Race digit (obsolete, always 8 in modern IDs) — digit 12
Z     = Check digit (Luhn algorithm) — digit 13
Important: SA ID numbers must be stored as text in Excel. If stored as a number, leading zeros are dropped (an ID starting with 0 becomes 12 digits) and the number may display in scientific notation. Always format the column as Text before entering ID numbers, or type an apostrophe before each: '9001155009087

16.7 Extracting Data from SA ID Numbers

Assume the SA ID number is stored as text in cell A2. All the following formulas use text functions (LEFT, MID, RIGHT) to extract specific digits, then convert them to usable values.

Extracting the Year of Birth

Raw year (2-digit):  =LEFT(A2,2) → "90" (for 9001155009087)

Full 4-digit year:   =IF(LEFT(A2,2)*1>=30,"19","20")&LEFT(A2,2)
                   → "1990" (YY >= 30 is assumed 1900s; YY < 30 is 2000s)
                   Note: The 30-year cutoff is a common convention.
                   00–29 = 2000–2029   30–99 = 1930–1999

Extracting the Month and Day of Birth

Month (2-digit text):  =MID(A2,3,2) → "01" (January)
Day (2-digit text):    =MID(A2,5,2) → "15"

Reconstructing the Full Date of Birth

=DATE(
   IF(VALUE(LEFT(A2,2))>=30,1900,2000)+VALUE(LEFT(A2,2)),
   VALUE(MID(A2,3,2)),
   VALUE(MID(A2,5,2))
)

Result: a proper Excel date value → format as dd/mm/yyyy to display 15/01/1990

Simplified on one line:
=DATE(IF(LEFT(A2,2)*1>=30,1900,2000)+LEFT(A2,2)*1,MID(A2,3,2)*1,MID(A2,5,2)*1)

Extracting Gender

Gender digit sequence (digits 7–10):
=VALUE(MID(A2,7,4)) → 5009 (for example ID)

Gender: =IF(VALUE(MID(A2,7,4))>=5000,"Male","Female")
   → "Male" (5000–9999 = Male, 0000–4999 = Female)

Extracting Citizenship Status

=IF(MID(A2,11,1)="0","SA Citizen","Permanent Resident")
→ "SA Citizen" (digit 11 = 0) or "Permanent Resident" (digit 11 = 1)

Calculating Age from the ID Number

DOB (from above formula) in B2:

Age (years):     =DATEDIF(B2,TODAY(),"Y")
Age (full text):  =DATEDIF(B2,TODAY(),"Y")&" years "&DATEDIF(B2,TODAY(),"YM")&" months"

Complete ID Information Extraction Table

ID in A2 = 9001155009087

Date of Birth:  =DATE(IF(LEFT(A2,2)*1>=30,1900,2000)+LEFT(A2,2)*1,MID(A2,3,2)*1,MID(A2,5,2)*1)
               → 15/01/1990

Age:            =DATEDIF(DOB,TODAY(),"Y") → 34

Gender:        =IF(VALUE(MID(A2,7,4))>=5000,"Male","Female") → "Male"

Citizenship:   =IF(MID(A2,11,1)="0","SA Citizen","Permanent Resident") → "SA Citizen"

16.8 Validating SA ID Numbers (Luhn Algorithm)

The 13th digit of every valid SA ID number is a check digit calculated using the Luhn algorithm. You can verify whether a given ID number is structurally valid (correct check digit) using Excel formulas.

Step-by-Step: How the Luhn Check Digit Works

  1. Take digits 1, 3, 5, 7, 9, 11 (odd positions) — sum them
  2. Take digits 2, 4, 6, 8, 10, 12 (even positions) — concatenate them into a number, multiply by 2, sum the individual digits of the result
  3. Add the two sums together
  4. The check digit (digit 13) must make the total sum a multiple of 10

Luhn Validation Formula (Assumes ID in A2)

This formula calculates whether the SA ID number passes the Luhn check:

Step 1 — Sum of odd-position digits (1,3,5,7,9,11,13):
=VALUE(MID(A2,1,1))+VALUE(MID(A2,3,1))+VALUE(MID(A2,5,1))
+VALUE(MID(A2,7,1))+VALUE(MID(A2,9,1))+VALUE(MID(A2,11,1))
+VALUE(MID(A2,13,1))

Step 2 — Even digits concatenated × 2, then digit-sum:
Even number = MID(A2,2,1)&MID(A2,4,1)&MID(A2,6,1)&MID(A2,8,1)&MID(A2,10,1)&MID(A2,12,1)
Doubled = VALUE(EvenNum)*2
Digit sum = Sum of individual digits of Doubled

Full validation (all-in-one — returns TRUE if valid):
=MOD(
  SUMPRODUCT(--MID(A2,{1,3,5,7,9,11,13},1))
  +SUMPRODUCT(--MID(TEXT(VALUE(MID(A2,{2,4,6,8,10,12},1))*2,"00"),{1,2},1)),
10)=0

Practical Validation Formula

A simpler approach using helper cells (easier to understand and audit):

Assume ID in A2 — put these in helper cells B2:N2 then validate:

B2: =VALUE(MID($A2,1,1))  — digit 1
C2: =VALUE(MID($A2,2,1))  — digit 2
... (D2 through N2 for digits 3–13)

OddSum:  =B2+D2+F2+H2+J2+L2+N2
EvenNum: =VALUE(C2&E2&G2&I2&K2&M2)*2
EvenSum:  sum of each digit of EvenNum
Total:    =OddSum+EvenSum
Valid:    =IF(MOD(Total,10)=0,"VALID","INVALID")

Quick Length and Format Checks

Correct length (13 digits):  =IF(LEN(A2)=13,"OK","Wrong length")
All digits (no letters):     =IF(ISNUMBER(VALUE(A2)),"OK","Contains non-digits")
Month valid (01–12):       =IF(AND(VALUE(MID(A2,3,2))>=1,VALUE(MID(A2,3,2))<=12),"OK","Invalid month")
Day valid (01–31):         =IF(AND(VALUE(MID(A2,5,2))>=1,VALUE(MID(A2,5,2))<=31),"OK","Invalid day")

16.9 Building an HR ID Extraction Template

A practical template that extracts all information from a column of SA ID numbers automatically:

Template Structure

ColumnHeaderFormula (row 2)
AID NumberEnter ID as text (format column as Text first)
BDate of Birth=DATE(IF(LEFT(A2,2)*1>=30,1900,2000)+LEFT(A2,2)*1,MID(A2,3,2)*1,MID(A2,5,2)*1)
CAge=IFERROR(DATEDIF(B2,TODAY(),"Y"),"")
DGender=IFERROR(IF(VALUE(MID(A2,7,4))>=5000,"Male","Female"),"")
ECitizenship=IFERROR(IF(MID(A2,11,1)="0","SA Citizen","Permanent Resident"),"")
FLength Check=IF(LEN(A2)=13,"✓","✗ Wrong length")
GID Valid (Luhn)=IF(LEN(A2)<>13,"Check length",IF(MOD(SUMPRODUCT(--MID(A2,{1,3,5,7,9,11,13},1))+SUMPRODUCT(--MID(TEXT(VALUE(MID(A2,{2,4,6,8,10,12},1))*2,"00"),{1,2},1)),10)=0,"VALID","INVALID"))
Template Tips:
  • Format column A as Text before entering any IDs (select column → Home → Number → Text)
  • Format column B as a date format (dd/mm/yyyy)
  • Wrap all ID extraction formulas with IFERROR(...,"") to show blank instead of errors for empty rows
  • Convert this range to an Excel Table (Ctrl+T) so formulas extend automatically as new employees are added
  • Add conditional formatting to column F and G to highlight invalid IDs in red

16.10 Quick Self-Check

Q1: You enter 15 into a cell and apply Percentage format. The cell shows 1500%. You wanted it to show 15%. What went wrong and how do you fix it?

✓ When you entered 15, Excel stored the number 15. Percentage format multiplies the stored value by 100 for display purposes only: 15 × 100 = 1500%. To display 15%, the stored value must be 0.15. Fix: delete the cell content → type 15% (Excel automatically stores 0.15 and displays 15%) OR type 0.15 and then apply Percentage format. Alternatively, keep the value as 15 and use a custom format code 0"%" which displays the literal number followed by a percent sign without multiplying by 100 — useful when your data is entered as whole percentages (like a rate column where 15 means 15%).

Q2: Last year's salary was R28,000 and this year's is R30,800. Write a formula to calculate the percentage increase, and write a second formula to calculate what the salary would be after a further 6% increase next year.

✓ Percentage increase (A2=28000, B2=30800): =(B2-A2)/A2 formatted as % → 10%. Equivalent: =B2/A2-1 → 0.10 = 10%. Next year salary with 6% increase: =B2*(1+6%) or =B2*1.06 → R32,648. You can also write =B2*(1+0.06) — all three are identical. The 6% in the formula is stored as 0.06, so =B2*1.06 adds 6% to the current salary of R30,800 to give R32,648.

Q3: An invoice total including 15% VAT is R9,890. Write formulas to: (a) extract the VAT amount, (b) calculate the price before VAT.

✓ Invoice inclusive price in A2 = R9,890. (a) VAT amount: =A2-(A2/1.15) → R1,290. Alternative: =A2*15/115 → R1,290. Both are mathematically identical: the inclusive price is 115% of the exclusive price, so the exclusive is A2/1.15 and the VAT portion is the difference. (b) Price before VAT: =A2/1.15 → R8,600. Verify: R8,600 + R1,290 = R9,890 ✓

Q4: An SA ID number is 8503205009083 (stored as text in A2). Write formulas to extract: (a) the date of birth as a proper Excel date, (b) the gender, (c) the citizenship status.

✓ (a) Date of birth: =DATE(IF(LEFT(A2,2)*1>=30,1900,2000)+LEFT(A2,2)*1, MID(A2,3,2)*1, MID(A2,5,2)*1). For 850320: YY=85 (≥30 so prefix 1900 → 1985), MM=03, DD=20 → result: 20/03/1985. (b) Gender: =IF(VALUE(MID(A2,7,4))>=5000,"Male","Female"). Digits 7–10 = 5009 ≥ 5000 → "Male". (c) Citizenship: =IF(MID(A2,11,1)="0","SA Citizen","Permanent Resident"). Digit 11 = 0 → "SA Citizen".

Q5: Why must SA ID numbers be stored as text in Excel, and how do you ensure this when building a spreadsheet that colleagues will use to enter IDs?

✓ SA IDs must be stored as text because: (1) IDs beginning with 0 will lose the leading zero if stored as a number, reducing the ID to 12 digits and making it invalid; (2) Excel may display long numbers in scientific notation (e.g., 8.5E+12) which corrupts the value; (3) text functions (LEFT, MID, RIGHT) work on text strings, not numbers. To ensure correct entry in a shared spreadsheet: (a) Select the entire ID column → Home → Number format dropdown → Text (before any data is entered — if formatted after entry, numbers must be re-entered). (b) Alternatively use Data Validation: Data → Data Validation → Allow: Text length → Equal to → 13 — this prevents non-13-digit entries and treats values as text. (c) Add a column F formula =IF(LEN(A2)=13,"✓","✗") as a visible length-check indicator.

Q6: Your budget for marketing this quarter is R150,000. Actual spend was R127,500. Calculate: (a) the Rand variance, (b) the percentage variance, (c) whether this is favourable or unfavourable, and (d) the percentage of budget actually spent.

✓ Budget in A2=150000, Actual in B2=127500. (a) Rand variance: =B2-A2 → −R22,500 (under budget). (b) Percentage variance: =(B2-A2)/A2 → −15% (spent 15% less than budget). (c) Favourable or unfavourable: For a cost budget, spending LESS than budget is favourable: =IF(B2<A2,"Favourable","Unfavourable") → "Favourable". (d) Percentage of budget spent: =B2/A2 formatted as % → 85% (R127,500 is 85% of R150,000). Reading it together: R22,500 under budget (15% variance) — a favourable outcome since the department spent only 85% of its allocated budget.

✓ Module 16 Complete — You Have Learned:

  • How Excel stores percentages — as decimal fractions (15% = 0.15); the three entry methods; the golden rule (store decimal, format as %); checking stored value with Ctrl+Shift+~
  • Basic percentage calculations — percentage of a value; using a rate cell; add/subtract a percentage (1+rate, 1−rate); share of total with absolute denominator (/SUM($B$7))
  • Back-calculating VAT — extracting VAT from an inclusive price (Price ÷ 1.15 vs Price − Price/1.15); extracting the exclusive price
  • Percentage change — formula (New−Old)/Old or New/Old−1; positive = increase, negative = decrease; handling #DIV/0! with IFERROR or IF
  • Budget variances — Rand variance; percentage variance; % of target achieved; favourable/unfavourable flag (cost vs revenue conventions); percentage contribution with absolute reference; cumulative running % with mixed reference $B$2:B2
  • Compound growth — PV*(1+rate)^n formula; salary projection; CAGR formula (B2/A2)^(1/n)−1; monthly compounding; FV() and PV() financial functions
  • SA ID number structure — 13-digit format: YYMMDD+GGGGG+C+A+Z; gender sequence (0000–4999 = Female, 5000–9999 = Male); citizenship digit; check digit; must store as text (leading zeros, 13-digit length)
  • Extracting data from SA IDs — LEFT/MID/RIGHT for year (with century: ≥30 = 1900s, <30 = 2000s), month, day; DATE() to reconstruct full date of birth; gender IF; citizenship IF; DATEDIF for age
  • Luhn algorithm validation — how the check digit works; full SUMPRODUCT validation formula; simpler helper-cell approach; quick format checks (LEN=13, ISNUMBER, month/day range)
  • HR ID extraction template — 7-column structure (ID, DOB, Age, Gender, Citizenship, Length Check, Luhn Valid); column A as Text; IFERROR wrappers; Table for auto-expansion; conditional formatting for invalid IDs

← Back to All Modules