XIRR is a financial function that calculates the internal rate of return for a series of cash flows that are not necessarily periodic. It is useful for modeling investments or projects that have irregular cash inflows and outflows over time.
XIRR takes into account the specific dates of each cash flow and returns a single rate of return that makes the net present value of the cash flows equal to zero. XIRR is similar to IRR, but IRR assumes that the cash flows are equally spaced, which may not be realistic in some cases. To use XIRR, you need to provide at least two arguments: values and dates. Values are the amounts of the cash flows, which must include at least one positive and one negative value. Dates are the dates corresponding to each cash flow, which must be in chronological order.