Formualizer Docs

XIRR

Calculates annualized internal rate of return for irregularly dated cash flows.

The solver uses Newton-Raphson on XNPV(rate, values, dates) = 0 with day-count basis 365.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=XIRR(values, dates, [guess])

Arguments

ArgumentTypeRequiredDefault
valuesanyRequired—
datesanyRequired—
guessnumberOptional—

Remarks

  • Output is an annualized rate.
  • Cash-flow sign convention requires at least one negative and one positive value.
  • guess defaults to 0.1 and can materially affect convergence.

Error cases

  • Non-numeric entries in value/date arrays are ignored; callable inputs return #CALC!.
  • Returns #NUM! for mismatched lengths, insufficient valid points, missing sign change, derivative failure, or non-convergence.

Examples

Find the rate for cash flows at irregular dates.

Formula =XIRR(A1:A3,B1:B3)

Input cells
AB
1-100=DATE(2024,1,1)
260=DATE(2024,9,1)
355=DATE(2025,5,1)

Expected result 0.153661538188134

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Choose a different initial guess for the numerical solver.

Formula =XIRR(A1:A3,B1:B3,0.15)

Input cells
AB
1-100=DATE(2024,1,1)
260=DATE(2024,9,1)
355=DATE(2025,5,1)

Expected result 0.153661538188134

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Use the minimum schedule of one outflow and one inflow.

Formula =XIRR(A1:A2,B1:B2)

Input cells
AB
1-100=DATE(2024,1,1)
260=DATE(2024,9,1)

Expected result -0.534267986223805

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The cash flow and date ranges must have the same length.

Formula =XIRR(A1:A3,B1:B2)

Input cells
AB
1-100=DATE(2024,1,1)
260=DATE(2024,9,1)
355

Expected result #NUM!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Find the annualized return on four receipts spaced 365 days apart.

Formula =XIRR({-10000,2750,4250,3250,2750}, {0,365,730,1095,1460})

Expected result 0.115412783100559

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Find the annualized return on unequally spaced receipts from a 10% starting guess.

Formula =XIRR({-5000,1200,1800,2400}, {0,180,365,730}, 0.1)

Expected result 0.0600182949212776

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

What data shape does XIRR require?

values and dates must have equal numeric length with at least one positive and one negative cash flow, or #NUM! is returned.

Implementation

Engine source

On this page