What did this investment earn per year? (XIRR)

Medium Math
Description
Hints 0/4
Solutions 2
–
Test case
1
2
3
Reset
Submit
fx
A
B
C
D
E
F
G
1
2
3
4
5
6
7
8
9
10
Loading interactive spreadsheet...
Preparing grid cells and formula calculation engine
○ Ready Enter formula in highlighted cells, then click Submit.

The problem

Problem statement

A client wants to know what a small investment actually earned per year. The dates are in A2:A6 and the money in and out is in B2:B6 — money paid in is negative, money received is positive. Put the annualized rate in the Annualized return cell D2, as a decimal (for example 0.1 for 10%).

Reference both columns instead of typing the dates into the formula: every case has the same five rows but different dates and amounts, and the dates stay in ascending order.

Problem data

Show the sheet as a table (selectable, copyable)
The exercise data, as a table
ABD
1 DateCash flowAnnualized return
2 2024-03-15-12000
3 2024-09-151500
4 2025-03-152000
5 2025-09-153000
6 2026-03-157000

Notes

XIRR discounts each flow by (date − first date) / 365, so a leap year does not change the basis. The dates in this sheet are real date values, displayed as yyyy-mm-dd — a date stored as text makes XIRR return #NUM!, because it can no longer read the day count. When the flows are evenly spaced, IRR answers a different question: it treats each row as one period, so the half-yearly case here reports about half the annualized rate.

How to approach

Your answer goes in D2. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.

  1. Target cell is D2
  2. Values first, dates second
  3. Money out is negative, money in is positive — a series with only one sign returns #NUM!
  4. Shape: =XIRR(?, ?)

Official solutions

Show 2 solutions — try it yourself first

Approach 1: point XIRR at the two columns

=XIRR(B2:B6, A2:A6)

12,000 paid out on 2024-03-15 comes back as 1,500 + 2,000 + 3,000 + 7,000 over the next two years, which annualizes to 0.0782 (7.82%). The dates carry the spacing, so nothing in the formula assumes a year.

Approach 2: state the guess explicitly

=XIRR(B2:B6, A2:A6, 0.1)

0.1 is exactly the starting point Excel uses when the third argument is omitted, so the answer does not change — writing it out makes the iteration visible, which is what you need when a series returns #NUM! and you want to try another start.

Function guide

Related practice

FAQ

What does XIRR return?

An annualized rate of return, as a decimal — 0.0782 is 7.82% once the cell is formatted as a percentage. It is the single constant rate that, compounded over the actual days between the payments, turns the money paid in into the money received.

Why is the expected answer 0.0782 instead of 7.82%?

Spreadsheets store percentages as decimals. 0.0782 formatted with % displays as 7.82%. Grading compares the stored number, so enter the decimal rather than text.

Why does IRR give a different number on the same cash flows?

IRR assumes every row is exactly one period apart. On the half-yearly case that treats two years of flows as five years, so IRR reports 6.70% where XIRR reports 13.82%. XIRR reads the dates, which is why it is the right function whenever the payments are not evenly spaced.

Why does XIRR return #NUM!?

Usually one of three things: every cash flow has the same sign (nothing to solve), the dates are stored as text so they read as 0 days apart (check with =ISNUMBER), or values and dates are different lengths. A fourth cause is the iteration not converging, which a different guess argument often fixes.