Sub topic 10
Cash flows on irregular dates
This chapter assumes you can enter formulas and ranges in Excel, understand compound interest, and can tell a real Excel date from text that looks like a date. It also assumes you know how NPV treats the t=0 cash flow, which an earlier chapter covered. Here the focus is on why unevenly spaced cash flows need a different approach, and on the day-count rule that approach uses.
Why periodic functions break on irregular dates
NPV and IRR see only a list of numbers. They never see dates. The first value is one period away (for NPV), the second is two periods away, and so on, whatever the calendar says.
That is correct when the cash flows are evenly spaced, such as 12 monthly payments or 5 year-end flows. Real projects often don't look like that:
- An invoice is paid 47 days late.
- A fund calls capital on 3 March, then 19 August, then 2 February.
- A loan is drawn on the 15th and repaid on the last day of a quarter.
If you put those flows in consecutive cells and call NPV, Excel treats them as if they were equally spaced. The result is wrong, and no error appears to warn you.
The fix is to attach a date to every cash flow and discount by the actual time elapsed.
The discount factor with dates
For periodic flows, the present value of the cash flow in period t is:
PV = CF / (1 + r)^t
with t counted in whole periods. For dated flows, replace t with the elapsed time in years since the first date:
PV = CF / (1 + r)^((d − d0) / 365)
Here d is the date of the cash flow, d0 is the date of the first cash flow, and r is an annual rate. This is the formula behind XNPV and XIRR, which later chapters cover in detail. Three consequences follow:
- The first date is the base date. Its cash flow has an exponent of 0, so it is not discounted at all. That is the same job the "add B3 outside
NPV" step does for the periodic function. - The discount rate must be an annual rate. The exponent is in years, so a monthly rate would be wrong.
- The year length is fixed at 365 days.
A worked example
The layout is below. The dates in column A must be real Excel dates, so enter them with DATE or type them in a format Excel converts.
D1: Discount rate = 10%
A2: 2026-01-01 B2: -10000
A3: 2026-04-01 B3: 3000
A4: 2026-07-01 B4: 3000
A5: 2027-01-01 B5: 5000The day offsets from 1 January 2026 are 0, 90, 181, and 365. With a 10% annual rate, the discount factors are about 1.0000, 1.0238, 1.0484, and 1.1000. The present values are about 3,000 / 1.0238 = 2,930, 3,000 / 1.0484 = 2,862, and 5,000 / 1.1 = 4,545. These sum to about 10,337, so the NPV is about +337.
Excel can compute this two ways. The SUMPRODUCT version shows the mechanism, and XNPV gives the same number directly:
Mechanism, written out:
=SUMPRODUCT(B2:B5 / (1 + D1)^((A2:A5 - A2) / 365))
Built-in function:
=XNPV(D1, B2:B5, A2:A5)Both return about 337. Now compare what happens if you ignore the dates and treat the same four values as evenly spaced yearly flows:
=NPV(D1, B3:B5) + B2This returns about −1,037. The sign of the answer flips, because the periodic function pushes the second cash flow a full year away when it is really 90 days away. That sign flip is what to watch for in a model.
The 365-day basis
XNPV and XIRR use actual calendar days divided by 365. They do not use 30/360, and they do not use actual/actual. Two things follow:
- A span across a leap year has an exponent slightly above 1. For example, 1 January 2028 minus 1 January 2027 is 365 days, but 1 January 2029 minus 1 January 2028 is 366 days. That gives an exponent of 366/365.
- If your lender or fund agreement defines interest on a different day-count convention,
XNPVwill not match their numbers exactly. In that case, build the discount factors yourself withSUMPRODUCTand the convention you need.
Month ends are not equally spaced either. Cash flows on 31 January, 28 February, and 31 March are 28 and 31 days apart, so a monthly NPV and an XNPV on those dates give slightly different answers. Neither is wrong. They answer different questions.
Rules the date range must follow
| Requirement | What happens if you break it |
|---|---|
| Dates are real date serial numbers | Text dates cause `#VALUE!` |
| Dates and cash flows have the same number of cells | `#NUM!` |
| No date is earlier than the first date in the range | `#NUM!` |
| Fractions of a day are not meaningful | Excel truncates dates to whole days |
The order of the later dates does not have to be sorted. The first date is the only one with a special role, so it must be the earliest. Sorting your data is still good practice, because a reader can check it against a timeline.
Checking that dates are dates
Dates pasted from another system are often text. Two quick checks catch this before it distorts a model:
Does every cell hold a number (a real date)?
=SUMPRODUCT(--ISNUMBER(A2:A5)) = ROWS(A2:A5)
Is the first date the earliest?
=A2 = MIN(A2:A5)Both should return TRUE. A cell that is left-aligned by default usually holds text. You can convert text to dates with DATEVALUE or the Text to Columns tool.
Converting rates between annual and monthly
Because the dated functions work in annual terms, you sometimes need to convert a monthly rate before using it, or the other way around. Compound the rate. Do not multiply by 12:
Annual from monthly: =(1 + monthly_rate)^12 - 1
Monthly from annual: =(1 + annual_rate)^(1/12) - 1For example, 10% annual becomes (1.10)^(1/12) − 1, which is about 0.797% per month.
Exercise
A project has these flows: -5,000 on 2026-03-01, +2,000 on 2026-05-15, and +4,000 on 2027-03-01. You use =NPV(8%, B3:B4) + B2 and get one answer, then =XNPV(8%, B2:B4, A2:A4) and get another. Which formula respects the timing, and what exponents does it apply to the second and third cash flows?
Show answer
XNPV respects the timing. The second flow is 75 days after the base date (March has 30 days left after the 1st, plus April's 30, plus 15 in May), so its exponent is 75/365, about 0.205 years. The third is exactly 365 days after the base date, so its exponent is 1. NPV instead uses exponents of 1 and 2 for the second and third flows, which overstates the delay of the second flow and the third.