Find the yearly return (XIRR) for an investment made and taken out on specific dates.
Solved numerically using Newton-Raphson iteration, since there's no simple algebraic formula for irregular cash flow dates.
XIRR: The discount rate where the sum of all cash flows, present-valued, equals zero
How is XIRR different from CAGR?
For a single investment put in and taken out once, they give the same answer. XIRR's advantage is that it can handle several payments on different dates — like a SIP with extra top-ups — which CAGR cannot do.