MSBA-175 · Lesson 8 of 12 · 20 min

Date, financial and statistical functions

▶ Video coming soon A video version of this lesson is on the way.

Maple & Pine lives by the calendar. Deposits fall due a set number of working days after booking, final payments are due before the event, and suppliers want their invoices paid within terms. In late October, Rosalind also started looking at financing a delivery van and wanted to know what the monthly payment would be. Dagny's eighth session covered three exam objectives that meet in these questions: use advanced date and time functions (NOW, TODAY, WEEKDAY and WORKDAY), the financial parts of perform data analysis (PMT and NPER), and troubleshoot formulas, because date and financial formulas are where subtle errors hide.

How Excel stores dates and times

Excel stores a date as a serial number: the number of days since January 0, 1900, so January 1, 1900 is 1 and January 1, 2027 is 46,388. A time is a fraction of a day: noon is 0.5 and 6:00 PM is 0.75. A date with a time is the sum of the two. Everything in this lesson follows from that. Subtracting two dates gives the number of days between them; adding 30 to a date gives the date 30 days later; formatting decides whether the number looks like a date.

NOW and TODAY

TODAY() returns the current date and NOW() returns the current date and time. Both take no arguments and both are volatile: they recalculate every time the workbook calculates, so a sheet that uses them is always current but never fixed. To stamp a fixed date, type it or press Ctrl+; (Ctrl+semicolon); Ctrl+Shift+; stamps the current time.

Days until the event; the date a 30-day quote expires; the time since a booking was logged; a check that is always TRUE.
=D5-TODAY()
=TODAY()+30
=NOW()-B5
=INT(NOW())=TODAY()

Dagny's days-to-event column uses =D5-TODAY() formatted as a number. On the event day it returns 0, before it positive numbers and after it negative numbers, which the conditional formatting rule from lesson 3 relies on.

WEEKDAY

WEEKDAY returns a number for the day of the week. Its second argument, return_type, decides which day is 1, and getting it wrong is a classic error.

return_typeNumberingUse
1 or omittedSunday = 1 to Saturday = 7The default
2Monday = 1 to Sunday = 7Weekends are 6 and 7, so >5 means weekend
3Monday = 0 to Sunday = 6Days since Monday
11 to 17Monday = 1 through Sunday = 1 as the first dayWeeks that start on other days

Return type 2 makes weekend tests simple: =WEEKDAY(D5,2)>5 is TRUE for Saturday and Sunday. With the default, the same test needs OR(WEEKDAY(D5)=1, WEEKDAY(D5)=7). To display the day name instead, use the TEXT function, =TEXT(D5,"dddd"), or a custom format, rather than WEEKDAY.

WORKDAY and NETWORKDAYS

WORKDAY returns the date a given number of working days before or after a start date, skipping Saturdays, Sundays and an optional list of holidays. Maple & Pine's contract says the deposit is due ten business days after the booking date.

Deposit due ten business days after booking; final payment 15 business days before the event; the same with an explicit weekend pattern; business days left before the event.
=WORKDAY(B5, 10, Holidays[Date])
=WORKDAY(D5, -15, Holidays[Date])
=WORKDAY.INTL(B5, 10, "0000011", Holidays[Date])
=NETWORKDAYS(TODAY(), D5, Holidays[Date])
A three-week calendar starting on a Friday booking date. WORKDAY counts ten business days forward, skipping three weekends and a holiday on the first Monday, and lands on the Monday 17 calendar days later, marked as the deposit due date.
WORKDAY skips weekends and listed holidays, so ten business days can span more than two weeks.

The holiday list is a table Dagny maintains each year with the provincial and federal statutory holidays that Maple & Pine observes. Because the argument is a table column, adding next year's holidays updates every due date. WORKDAY.INTL adds a weekend argument for businesses that work weekends: a seven-character string of 1s and 0s from Monday to Sunday, where 1 means a day off, or a number code such as 11 for Sunday only. Event companies often work Saturdays, so Dagny used "0000001" for the coordinator schedule.

Worked problem

When is the final payment due?

A wedding is on Saturday, June 12, 2027. Final payment is due 15 business days before the event, counting Monday to Friday and skipping holidays in Holidays[Date]. Write the formula and explain why the result is not simply three weeks earlier.

Show solution
  1. Use WORKDAY with the event date as the start: WORKDAY(D5, -15, Holidays[Date]).
  2. A negative number of days counts backwards.
  3. Fifteen business days is three working weeks only if no holiday falls in between.
  4. If a holiday falls in the period, WORKDAY moves one more business day earlier.

Answer: =WORKDAY(D5,-15,Holidays[Date]). Without holidays it returns Monday, May 24, 2027, which is itself a holiday in Canada, so with the holiday list it returns the business day before, Friday, May 21. On the US site the result depends on the holidays in the list.

Other date functions worth knowing

Several functions not named on the exam appear in date tasks as helpers. DATE(year, month, day) builds a date from parts and rolls over correctly, so DATE(2027,13,1) is January 1, 2028. YEAR, MONTH and DAY take a date apart. EDATE(start, months) returns the same day a number of months later, and EOMONTH(start, months) returns the last day of a month, which Dagny uses for month-end cut-offs. DATEDIF and YEARFRAC measure intervals in whole units or fractions of a year.

PMT: the payment on a loan

PMT returns the regular payment on a loan with a constant interest rate. Its arguments are the rate per period, the number of periods, the present value (the amount borrowed) and two optional ones: the future value, and the type (0 for payments at the end of each period, 1 for the start).

The syntax; the monthly payment on a 48,000 van loan at 6.9 percent a year over five years; the same shown as a positive number; with an 8,000 balloon payment at the end.
=PMT(rate, nper, pv, [fv], [type])
=PMT(0.069/12, 60, 48000)
=-PMT(0.069/12, 60, 48000)
=PMT(0.069/12, 60, 48000, -8000)

The two rules that cause most errors are matching the periods and the sign convention. The rate and the number of periods must use the same unit: a yearly rate of 6.9 percent paid monthly over five years is a rate of 0.069/12 for 60 periods. And Excel treats money received as positive and money paid as negative, so borrowing 48,000 (received) gives a negative payment of about 948.20 (paid out). Putting a minus sign in front of PMT, or entering the loan as a negative, shows the payment as a positive number.

NPER: how many payments

NPER answers the reverse question: how many periods does it take to pay off a loan, or to reach a savings goal, at a given payment? Its arguments are rate, payment, present value and the optional future value and type.

Months to repay the van loan at 1,200 a month (about 45.6); months to save 25,000 for a new marquee at 500 a month earning 3.5 percent (about 46.7).
=NPER(0.069/12, -1200, 48000)
=NPER(0.035/12, -500, 0, 25000)

The exam objective is worded forecast data by using the AND(), IF(), and NPER() functions, which describes formulas that combine them, such as checking whether a savings plan reaches its goal in time. Dagny built one for the marquee fund: =IF(AND(NPER(0.035/12,-B2,0,15000)<=36, B2<=700), "On track", "Review"), which says "On track" if the monthly saving in B2 reaches a 15,000 deposit for the marquee within three years and stays within the 700 a month Rosalind said she could afford.

FunctionAnswersRemember
PMTWhat is the payment per period?Rate and periods in the same unit; result negative for a loan received
NPERHow many periods?Payment negative when present value is positive
PVHow much can I borrow for this payment?Same arguments, solving for the present value
FVHow much will this grow to?Same arguments, solving for the future value
RATEWhat interest rate is this?Iterative; may need a guess

Statistical functions for describing data

The exam objective names only the conditional aggregation functions from lesson 5 for statistics, but Expert-level tasks often ask you to describe a set of values, and a handful of statistical functions cover nearly every case. Dagny used them on the guest counts of the 2026 weddings to answer Rosalind's question, "What is a typical wedding for us?"

FunctionReturnsGuest counts example
AVERAGEThe arithmetic mean118
MEDIANThe middle value; resistant to extreme values104
MODE.SNGLThe most frequent value120
STDEV.SThe standard deviation of a sampleAbout 46
PERCENTILE.INCThe value below which a given share of values falls90th percentile about 180
QUARTILE.INCThe quartile boundariesQ1 about 82, Q3 about 146
RANK.EQA value's rank in a listA 230-guest wedding ranks 2nd
LARGE / SMALLThe k-th largest or smallest valueLARGE(list,3) is the third largest

The mean was pulled upward by two very large weddings, which is why the median was the better answer to "typical". Lesson 11 shows the same data as a box and whisker chart, which draws the quartiles and outliers that these functions calculate. All of these functions ignore text and blank cells in a range, but they include zeros, so a guest count of 0 entered as a placeholder drags the average down; filtering with AVERAGEIFS(Bookings[Guests], Bookings[Guests], ">0") avoids that.

The median wedding size using FILTER from lesson 7; the 90th percentile of guest counts; a booking's rank, largest first.
=MEDIAN(FILTER(Bookings[Guests], Bookings[Event type]="Wedding"))
=PERCENTILE.INC(Bookings[Guests], 0.9)
=RANK.EQ(C5, Bookings[Guests], 0)

The figures in the table are illustrative values for Maple & Pine's 2026 weddings, not industry statistics.

Troubleshooting formulas

The exam objective troubleshoot formulas lists four tools: trace precedence and dependence, the Watch Window, error checking rules, and Evaluate Formula. All four are on the Formulas > Formula Auditing group.

Trace Precedents draws blue arrows from the cells a formula uses to the formula; Trace Dependents draws arrows from the selected cell to the formulas that use it. Clicking again traces another level. A black dashed arrow with a small sheet icon means the link goes to another sheet or workbook; double-clicking it opens Go To with the destinations. Remove Arrows clears them. Dagny traced the van payment cell back to find that the rate came from a cell labelled "yearly" but containing a monthly figure.

The Watch Window keeps chosen cells in view while you work elsewhere. Add a watch, and the window shows the workbook, sheet, name, cell, current value and formula, updating as values change. Dagny watched the budget's net income cell while editing venue costs on another sheet.

Error checking is controlled by rules in File > Options > Formulas > Error checking rules: cells containing formulas that result in an error, numbers formatted as text, formulas inconsistent with adjacent formulas, formulas omitting cells in a region, unlocked cells containing formulas, and others. A green triangle marks a cell breaking a rule, and Formulas > Error Checking steps through them one by one. Evaluate Formula shows a formula with the next part to be calculated underlined; each click of Evaluate calculates that part, and Step In follows a reference into its own formula.

Worked problem

Why is the payment so high?

The van payment shows about 3,370 a month instead of the expected 948. The formula is =-PMT(B2,B3,B4) with B2 = 0.069, B3 = 60 and B4 = 48,000. Use the auditing tools to find the problem.

Show solution
  1. Select the payment cell and choose Formulas > Evaluate Formula.
  2. Click Evaluate and watch B2 become 0.069, a yearly rate used as a monthly one.
  3. Trace Precedents to confirm which cells feed the formula.
  4. Fix the formula to =-PMT(B2/12,B3,B4) and confirm it returns about 948.

Answer: The rate was annual while the periods were monthly. Dividing the rate by 12 matches the units.

Common mistakes

  • MistakeUsing a yearly rate with monthly periods in PMT or NPER.

    InsteadDivide the rate by 12 and use months for the periods.

  • MistakeUsing WEEKDAY(D5)>5 to test for weekends.

    InsteadUse WEEKDAY(D5,2)>5, where Saturday and Sunday are 6 and 7.

  • MistakeUsing TODAY() to record when something happened.

    InsteadStamp a fixed date with Ctrl+; because TODAY() changes daily.

  • MistakeLeaving holidays out of WORKDAY.

    InsteadPoint the holidays argument at a maintained list.

  • MistakeFixing a number without tracing where it came from.

    InsteadUse Trace Precedents and Evaluate Formula to find the cause.

Summary and key terms

  • Dates are serial numbers and times are fractions of a day; NOW and TODAY are volatile.
  • WEEKDAY's return_type decides which day is 1; type 2 makes Saturday 6 and Sunday 7.
  • WORKDAY adds business days and skips holidays; WORKDAY.INTL sets custom weekends.
  • PMT returns a loan payment and NPER the number of periods; match the period units and mind the signs.
  • Trace arrows, the Watch Window, error checking rules and Evaluate Formula troubleshoot formulas.
Serial number
The number Excel uses to store a date.
Volatile function
A function that recalculates every time the workbook calculates.
WORKDAY
A function that returns a date a number of business days from a start date.
PMT
A function that returns the periodic payment for a loan or investment.
NPER
A function that returns the number of periods for a loan or investment.
Watch Window
A window that shows chosen cells' values while you work elsewhere.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which shortcut enters today's date as a fixed value?

    Show answer

    Ctrl+; (Ctrl+semicolon).

  2. What rate argument does PMT need for 6 percent a year paid monthly?

    Show answer

    0.06/12.

  3. Which function counts business days between two dates?

    Show answer

    NETWORKDAYS.

  4. Which tool calculates a formula one part at a time?

    Show answer

    Evaluate Formula.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz