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 15: Currency, Date & Time Calculations

Three of the most common data types in South African business spreadsheets — currency amounts in Rand, calendar dates, and clock times — each have unique rules, formatting requirements, and calculation techniques. This module teaches you how to format Rand correctly, how Excel stores and calculates with dates and times internally, how to calculate the difference between two dates, how to add or subtract time periods, and which functions to use for payroll dates, project deadlines, working-day calculations, and financial period analysis.

15.1 Currency Formatting in Excel

Currency formatting does not change the underlying numeric value — it controls only how the number displays. Excel stores 1500.5 regardless of whether you see it as R 1,500.50, $1,500.50, or just 1500.5. Calculations always use the stored value.

Applying the Rand (R) Currency Format

MethodHowResult
Accounting Button ($) Select cells → Home → Number group → click the $ dropdown ▼ → select R Afrikaans (South Africa) R  1,500.50 (Rand symbol left-aligned, decimals right-aligned, zeros show as -)
Number Format Dropdown Select cells → Home → Number dropdown → More Number Formats… → Category: Currency → Symbol: R R1,500.50 (symbol attached to number, negatives in red)
Custom Format Ctrl+1 → Number → Custom → type format code Full control over appearance

Custom Rand Format Codes

Format CodeDisplays AsUse For
"R "#,##0.00R 1,500.50Standard Rand with 2 decimal places — most common
"R "#,##0R 1,500Rand without decimals — for whole-Rand amounts
"R "#,##0.00;[Red]"(R "#,##0.00")"Positives: R 1,500.50 • Negatives: (R 250.00) in redFinancial statements where negatives shown in brackets
"R "#,##0.00;[Red]"-R "#,##0.00;"—"Positives normal, negatives red with minus, zeros show as —Income statements where zero balances should be clear
"R "#,##0,,"M"R 1.5M (for 1,500,000)Executive dashboards showing millions
"R "#,##0,"k"R 1,500k (for 1,500,000)Charts and summaries in thousands

Currency vs Accounting Format

AspectCurrency FormatAccounting Format
Symbol positionImmediately left of the number: R1,500.50Far left of the cell, number right-aligned: R  1,500.50
Zero valuesR0.00A dash: —
Negatives-R1,500.50 or (R1,500.50) or red(R1,500.50) in brackets
Column alignmentDecimal points may not align in a columnDecimal points always align vertically — standard for financial reports
Best forGeneral use, invoices, price listsFinancial statements, payroll, any report where columns of figures must be clearly comparable

Multi-Currency Worksheets

When working with multiple currencies (Rand, USD, EUR, GBP) in the same workbook:

  • Store all amounts in their original currency — do not pre-convert
  • Apply the appropriate currency format to each column or cell
  • Use a separate exchange rate table for conversions: =USD_Amount * ExchangeRate_USD_ZAR
  • Flag the currency in a separate column (text: "ZAR", "USD", "EUR") to avoid ambiguity

15.2 How Excel Stores Dates — The Date Serial Number

Understanding this is the key to all date calculations. Excel does not store dates as text like "15 January 2025". It stores every date as a serial number — an integer representing the number of days since a fixed starting point.

The Date Serial System

Serial 1   → 1 January 1900
Serial 2   → 2 January 1900
Serial 44927 → 1 January 2023
Serial 45292 → 1 January 2024
Serial 45658 → 1 January 2025

Each day = serial number increases by 1
Subtraction: 45658 - 45292 = 366 → 2024 was a leap year (366 days)

Why This Matters

  • Because dates are numbers, you can subtract two dates to find the number of days between them: =B2-A2
  • You can add days to a date: =A2+30 gives you the date 30 days after A2
  • You can use dates in SUM, AVERAGE, MAX, MIN: =MAX(A2:A100) finds the latest date
  • If a date displays as a number (e.g., 45658), the cell format is set to General or Number instead of a date format — apply a date format to fix the display

Checking a Date's Serial Number

  • Select a cell with a date → press Ctrl+Shift+~ (General format) — the serial number appears
  • Or: =DATEVALUE("15/01/2025") returns the serial number for that date text
  • Press Ctrl+Z to restore the date format

15.3 Date Entry & Formatting

Entering Dates Correctly

You TypeRecognised AsNotes
15/01/202515 January 2025DD/MM/YYYY — the SA standard. Excel right-aligns confirmed dates.
15-01-202515 January 2025Hyphens also work as date separators
15 Jan 202515 January 2025Month name format — unambiguous
15 January 202515 January 2025Full month name also recognised
Ctrl+;Today's date (static)Inserts the current date as a fixed value — does NOT update tomorrow
SA Date Entry Warning: Windows regional settings in South Africa use DD/MM/YYYY. Always enter day before month (15/01 = 15 January). If Excel interprets 05/03/2025 as 5 March instead of 3 May, your Windows regional settings may be set to US format (MM/DD/YYYY). Fix in Windows: Control Panel → Region → Format → Short date → DD/MM/YYYY.

Date Format Codes

Apply via Ctrl+1 → Number → Custom:

Format CodeDisplays AsUse For
dd/mm/yyyy15/01/2025SA standard short date
dd mmm yyyy15 Jan 2025Abbreviated month
dd mmmm yyyy15 January 2025Full month name — formal documents
dddd, dd mmmm yyyyWednesday, 15 January 2025Including day of week
mmm-yyJan-25Month-year labels in charts and reports
mmmm yyyyJanuary 2025Month and year only (day ignored visually)
yyyy-mm-dd2025-01-15ISO 8601 format — for systems/databases

15.4 Essential Date Functions

TODAY() and NOW()

FunctionReturnsUpdates
=TODAY()Today's date (no time component)Yes — recalculates every time the workbook opens or recalculates. Useful for age calculations and deadline alerts.
=NOW()Current date AND time (date + fractional day)Yes — recalculates continuously (or on each recalculation). Format with a date+time format to display both components.

DATE(), YEAR(), MONTH(), DAY() — Building and Extracting Dates

FunctionSyntaxExample & Result
DATE =DATE(year, month, day) =DATE(2025, 3, 31) → 31 March 2025. Used to construct a date from year, month, day values stored in separate cells or calculated values.
YEAR =YEAR(date) =YEAR(A2) → 2025 (if A2 = 15/01/2025). Extracts the year component from a date.
MONTH =MONTH(date) =MONTH(A2) → 1 (for January). Returns 1 through 12.
DAY =DAY(date) =DAY(A2) → 15 (the day of the month). Returns 1 through 31.
WEEKDAY =WEEKDAY(date, [return_type]) =WEEKDAY(A2, 2) → 1=Mon through 7=Sun (return_type 2). Used to identify weekends: =IF(WEEKDAY(A2,2)>5,"Weekend","Weekday")
EOMONTH =EOMONTH(start_date, months) =EOMONTH(A2, 0) → last day of the same month as A2. =EOMONTH(A2, 1) → last day of next month. Used for month-end billing dates and financial period calculations.
EDATE =EDATE(start_date, months) =EDATE(A2, 3) → same day 3 months later. =EDATE(A2, -1) → same day one month earlier. Used for subscription renewal dates, lease end dates, instalment schedules.

TEXT Function for Date Formatting

Convert a date to a formatted text string for display in concatenated text:

=TEXT(A2,"dd mmmm yyyy") → "15 January 2025"
="Report date: "&TEXT(TODAY(),"dd/mm/yyyy") → "Report date: 15/01/2025"
="Invoice for "&TEXT(A2,"mmmm yyyy") → "Invoice for January 2025"

15.5 Date Difference Calculations

Calculating the difference between two dates is one of the most common date tasks in Excel — for age calculations, tenure, project duration, days overdue, and lease terms.

Simple Date Subtraction

=B2-A2       — number of days between A2 and B2
=TODAY()-A2 — days from A2 to today (age in days, days overdue, etc.)
=(B2-A2)/7   — number of weeks between two dates
=(B2-A2)/30.44 — approximate months (30.44 = average days per month)
Format the result correctly: After subtracting two dates, format the result cell as Number (not Date). If you see a date like "11 Jan 1900" instead of "41 days", the cell is formatted as a date — press Ctrl+Shift+~ to apply General format, or Home → Number → Number.

DATEDIF — The Date Difference Function

DATEDIF (Date Difference) calculates the difference between two dates in complete years, months, or days. It is a hidden function — it does not appear in IntelliSense but it works in all Excel versions.

=DATEDIF(start_date, end_date, unit)
UnitReturnsExample
"Y"Complete years=DATEDIF(A2,TODAY(),"Y") → age in complete years
"M"Complete months=DATEDIF(A2,TODAY(),"M") → tenure in complete months
"D"Total days=DATEDIF(A2,TODAY(),"D") → same as TODAY()-A2
"YM"Months beyond the last complete year=DATEDIF(A2,TODAY(),"YM") → the remaining months after counting complete years (0–11)
"MD"Days beyond the last complete month=DATEDIF(A2,TODAY(),"MD") → remaining days after counting complete months (0–30)
"YD"Days beyond the last complete year=DATEDIF(A2,TODAY(),"YD") → remaining days within the current year

Age Calculation — Full Example

Date of Birth in A2 = 15/08/1990
Today = 15/01/2025

Age in years:              =DATEDIF(A2,TODAY(),"Y") → 34
Age in years and months:    =DATEDIF(A2,TODAY(),"Y")&" years "&DATEDIF(A2,TODAY(),"YM")&" months"
                          → "34 years 5 months"

Employee tenure:           =DATEDIF(StartDate,TODAY(),"Y")&" years, "&DATEDIF(StartDate,TODAY(),"YM")&" months"

NETWORKDAYS — Working Days Between Two Dates

=NETWORKDAYS(start_date, end_date, [holidays])
  • Returns the number of working days (Monday–Friday) between two dates, excluding weekends
  • Optional holidays argument: a range listing public holidays to exclude (e.g., your SA public holidays list)
=NETWORKDAYS(A2,B2) — working days between A2 and B2, excluding weekends
=NETWORKDAYS(A2,B2,H2:H15) — working days excluding weekends AND the public holidays in H2:H15

NETWORKDAYS.INTL — Custom Weekends

=NETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays])
=NETWORKDAYS.INTL(A2,B2,11,H2:H15) — weekends = Sunday only (weekend code 11)

Use NETWORKDAYS.INTL when your organisation's non-working days are not Saturday+Sunday (e.g., some sectors work Saturdays; some regions have Friday+Saturday as weekend).

WORKDAY — Find a Date N Working Days Later

=WORKDAY(start_date, days, [holidays])
=WORKDAY(A2, 10) — the date 10 working days after A2
=WORKDAY(A2, -5, H2:H15) — the date 5 working days before A2, excluding holidays

Use WORKDAY for: delivery deadlines (ship date + 5 working days = expected delivery), payment due dates, SLA response deadlines.

15.6 SA Public Holidays — Setting Up a Holiday Table

For NETWORKDAYS and WORKDAY to exclude SA public holidays, create a holiday table on a dedicated sheet:

Creating the SA Public Holiday Table

  1. Add a sheet named "PublicHolidays"
  2. Column A: holiday dates (as proper Excel date values)
  3. Column B: holiday names (for reference)
  4. Name the date range: select A2:A20 → Name Box → type SAHolidays → Enter
DateSA Public Holiday
01/01/2025New Year's Day
21/03/2025Human Rights Day
18/04/2025Good Friday
21/04/2025Family Day
27/04/2025Freedom Day
01/05/2025Workers' Day
16/06/2025Youth Day
09/08/2025National Women's Day
24/09/2025Heritage Day
16/12/2025Day of Reconciliation
25/12/2025Christmas Day
26/12/2025Day of Goodwill
Using the named holiday range:
=NETWORKDAYS(A2,B2,SAHolidays) — working days excluding SA public holidays
=WORKDAY(A2,10,SAHolidays) — 10 working days from A2 excluding SA holidays

15.7 How Excel Stores Time — Fractional Day Numbers

Time in Excel is stored as a decimal fraction of a day. Midnight = 0, noon = 0.5, end of day = 0.999… This means a cell can hold a date-and-time combined as a single number: the integer part = the date, the decimal part = the time.

00:00 (midnight) → 0.0000
06:00 (6 AM)   → 0.2500  (6/24)
12:00 (noon)   → 0.5000  (12/24)
18:00 (6 PM)   → 0.7500  (18/24)
08:30         → 0.3542  (8.5/24)
Combined date+time: 15 Jan 2025 at 08:30 → 45658.3542

Entering Times

You TypeDisplays As
08:308:30 AM (24-hour or AM/PM depending on regional settings)
14:452:45 PM
8:30 PM8:30 PM
Ctrl+Shift+;Current time (static — does not update)

Time Format Codes

Format CodeDisplays As
hh:mm08:30 (24-hour)
h:mm AM/PM8:30 AM
hh:mm:ss08:30:45
[h]:mmElapsed hours — can exceed 24 (e.g., 36:30 for 36 hours 30 minutes). Essential for timesheet totals.
[h]:mm:ssElapsed hours with seconds — e.g., 36:30:00

15.8 Time Calculations

Calculating Hours Worked

Start time in A2 = 08:00     End time in B2 = 17:30

Hours worked:               =B2-A2 → 0.395833... (format as [h]:mm to show 9:30)
Hours as a number:          =(B2-A2)*24 → 9.5 (hours with decimal fraction)
Hours worked (whole hours): =INT((B2-A2)*24) → 9
Minutes remaining:         =MOD((B2-A2)*24*60,60) → 30
Timesheet Totals — The [h]:mm Format is Essential:
If you sum 5 days of hours (e.g., 8:00 + 9:30 + 8:45 + 8:00 + 9:00 = 43 hours 15 minutes), formatting the total as hh:mm shows 19:15 (it wraps around at 24!). You MUST format the total cell as [h]:mm to show 43:15. The square brackets tell Excel to display the full elapsed hours beyond 24.

Converting Time to Hours for Payroll

Time worked in C2 = 09:30 (stored as 0.395833)

Hours as decimal:        =C2*24 → 9.5
Pay calculation:        =(C2*24)*HourlyRate → 9.5 hours × rate
Weekly hours total:     =SUM(C2:C6)*24 → total decimal hours for the week
Overtime check:        =IF(SUM(C2:C6)*24>45,"Overtime","Normal")

TIME() Function — Creating Time Values

=TIME(hour, minute, second)
=TIME(8, 30, 0) → 8:30 AM
=TIME(14, 45, 0) → 14:45
=A2+TIME(1,30,0) → adds 1 hour 30 minutes to the time in A2

HOUR(), MINUTE(), SECOND() — Extracting Time Components

=HOUR(A2)    → the hour component (0–23)
=MINUTE(A2) → the minute component (0–59)
=SECOND(A2) → the second component (0–59)

Handling Times Past Midnight

When end time is after midnight (night shift: start 22:00, end 06:00 next day), simple subtraction gives a negative result. Fix:

=IF(B2<A2, 1+B2-A2, B2-A2) → handles overnight shifts
or: =MOD(B2-A2, 1) → MOD with 1 automatically handles negative times

15.9 SA Payroll & Finance Date Scenarios

Employee Age Verification (FICA/Hiring)

Date of birth in A2:
Age:                       =DATEDIF(A2,TODAY(),"Y")
Is over 18?               =IF(DATEDIF(A2,TODAY(),"Y")>=18,"Yes","No")
Retirement eligible (>=60)? =IF(DATEDIF(A2,TODAY(),"Y")>=60,"Eligible","Not yet")
Next birthday:            =DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))+(IF(DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))<TODAY(),1,0)*366)

Leave and Payroll Calculations

Employment start date in A2, Leave start in B2, Leave end in C2:

Service years:         =DATEDIF(A2,TODAY(),"Y")
Leave days taken:      =NETWORKDAYS(B2,C2,SAHolidays)-1
Annual leave entitlement: =IF(DATEDIF(A2,TODAY(),"Y")>=1,15,ROUND(DATEDIF(A2,TODAY(),"M")/12*15,0))
Days since last payslip:  =TODAY()-EOMONTH(TODAY(),-1)
Next payroll date:      =WORKDAY(EOMONTH(TODAY(),0),3,SAHolidays)

Invoice and Payment Terms

Invoice date in A2, Payment terms in B2 (e.g., 30):

Due date:           =A2+B2
Due date (working days): =WORKDAY(A2,B2,SAHolidays)
Days overdue:       =MAX(0,TODAY()-(A2+B2)) → 0 if not yet due
Status:             =IF(TODAY()>A2+B2,"OVERDUE","Current")
Days until due:     =(A2+B2)-TODAY()

Financial Year Calculations (SA: 1 March – 28/29 February)

Current financial year start:
=IF(MONTH(TODAY())>=3, DATE(YEAR(TODAY()),3,1), DATE(YEAR(TODAY())-1,3,1))

Financial year end (28/29 Feb):
=EOMONTH(DATE(IF(MONTH(TODAY())>=3,YEAR(TODAY())+1,YEAR(TODAY())),2,1),0)

Is date in current financial year?
=AND(A2>=FinYearStart, A2<=FinYearEnd)

15.10 Quick Self-Check

Q1: A cell containing the date 15/01/2025 suddenly shows "45658" instead. What happened and how do you fix it?

✓ The cell format was changed to General or Number, so the underlying serial number is now visible instead of the formatted date. Excel stores every date as a serial number (days since 1 January 1900 — 45658 = 15 January 2025). Fix: select the cell → Home → Number Format dropdown → Short Date (or Long Date) — or press Ctrl+1 → Number → Date → choose the desired date format. The date 15/01/2025 reappears. The serial number has not changed; only the display format was lost.

Q2: An employee's date of birth is in cell A2 (15/08/1990). Write a formula that displays their age in years and months in a readable format, e.g., "34 years 5 months".

✓ =DATEDIF(A2,TODAY(),"Y")&" years "&DATEDIF(A2,TODAY(),"YM")&" months". The first DATEDIF with "Y" returns the complete years (34). The second DATEDIF with "YM" returns the additional months beyond the last complete year (5). The & operator joins the text into a readable sentence. Note that the end_date must be after the start_date in DATEDIF or it returns a #NUM! error — use TODAY() which is always after any birth date.

Q3: You are calculating the hours worked for a timesheet. Cell A2 = 08:00 (start) and B2 = 17:30 (end). After entering =B2-A2 and summing all 5 days, the weekly total shows 19:15 instead of 43:15. What is the problem and how do you fix it?

✓ The total cell is formatted with hh:mm which resets to zero at 24 hours. 43:15 rolls over twice past 24, displaying 43-24-24=−5, then 24+(−5)=19:15. Fix: select the total cell → Ctrl+1 → Number → Custom → type [h]:mm → OK. The square brackets around h tell Excel to show the true elapsed hours without resetting at 24, so 43:15 displays correctly. This is essential for any timesheet where weekly hours can exceed 24.

Q4: An invoice was issued on 15 January 2025 (in A2) with 30-day payment terms. Write formulas to: (a) calculate the due date, (b) show whether the invoice is overdue or current, (c) count the days overdue if it is past due.

✓ (a) Due date: =A2+30. Simple date addition — Excel adds 30 days to the date serial number, giving 14 February 2025. (b) Status: =IF(TODAY()>A2+30,"OVERDUE","Current"). Compares today's date to the due date. (c) Days overdue: =MAX(0,TODAY()-(A2+30)). If today is before the due date, TODAY()-due_date is negative, and MAX(0,...) returns 0 (not yet due). If today is after the due date, it returns the positive number of days past due.

Q5: You need to calculate the number of working days between two project dates, excluding weekends AND South African public holidays (stored in a named range "SAHolidays"). The start date is in A2, the end date in B2. Write the formula.

✓ =NETWORKDAYS(A2,B2,SAHolidays). NETWORKDAYS counts working days (Monday through Friday) between two dates inclusively. The third argument (SAHolidays) specifies a list of additional non-working days to exclude. The formula automatically skips all weekends and all dates listed in the SAHolidays range. Note: NETWORKDAYS counts both the start and end dates if they fall on working days (it is inclusive at both ends), so =NETWORKDAYS(A2,B2)-1 if you want to exclude the start date.

Q6: What is the difference between the Currency and Accounting number formats in Excel? Which is preferred for financial statements and why?

✓ Currency format: places the symbol immediately adjacent to the number (R1,500.50), shows zero as R0.00, and negatives in red or with a minus sign. Accounting format: aligns the currency symbol to the far left of the cell with the number right-aligned (R  1,500.50), shows zero as a dash (—), and negatives in brackets. For financial statements, the Accounting format is preferred because: (1) decimal points always align vertically in a column making figures easier to compare; (2) the symbol alignment is consistent and professional; (3) zeros as dashes are the accounting convention distinguishing a zero balance from a missing entry; (4) negatives in brackets is the standard accounting notation rather than a minus sign which can be confused with a hyphen.

✓ Module 15 Complete — You Have Learned:

  • Currency formatting — Accounting button ($) dropdown for Rand; Custom format codes for R with decimals, whole Rand, negatives in brackets/red, millions/thousands abbreviations; Currency vs Accounting format (5-row comparison — symbol position, zeros, negatives, alignment); multi-currency workbook approach
  • Date serial numbers — Excel stores dates as integers (days since 1 Jan 1900); serial number examples; why this enables date arithmetic; how to view the serial (Ctrl+Shift+~); fixing dates that display as numbers
  • Date entry — DD/MM/YYYY as SA standard; all accepted formats; Ctrl+; for static today; SA date entry warning (Windows regional settings DD/MM vs MM/DD)
  • Date format codes — dd/mm/yyyy, dd mmm yyyy, dd mmmm yyyy, dddd comma date, mmm-yy, mmmm yyyy, yyyy-mm-dd (ISO)
  • Date functions — TODAY() and NOW() (auto-update); DATE(y,m,d) to construct; YEAR/MONTH/DAY to extract; WEEKDAY with return_type 2 (1=Mon, 7=Sun); EOMONTH for month-end dates; EDATE for same-day N months later; TEXT for date-in-string formatting
  • Date difference — simple subtraction (format result as Number not Date); DATEDIF with all 6 units ("Y","M","D","YM","MD","YD"); full age-in-years-and-months formula example
  • NETWORKDAYS — working days between dates excluding weekends; optional holidays argument; NETWORKDAYS.INTL for custom weekend definitions; WORKDAY to find date N working days from a start
  • SA Public Holidays table — 12 SA public holidays 2025; creating a SAHolidays named range; using it in NETWORKDAYS and WORKDAY
  • Time serial fractions — midnight=0, noon=0.5; time entry formats; time format codes (hh:mm, h:mm AM/PM, hh:mm:ss, [h]:mm for elapsed hours >24)
  • Time calculations — hours worked (B2-A2); converting to decimal hours (*24); total weekly hours with [h]:mm format; TIME(h,m,s) to create; HOUR/MINUTE/SECOND to extract; overnight shift formula (MOD or IF)
  • SA payroll/finance formulas — age verification, retirement eligibility, leave days (NETWORKDAYS), annual leave entitlement, next payroll date (WORKDAY+EOMONTH), invoice due date, days overdue (MAX(0,...)), financial year start/end (SA: 1 March–28/29 Feb)

← Back to All Modules