I'm trying to calculate IRR from the below cash flows and get slightly different results using tvm::xirr compared to XIRR from Excel.
Dates= c("2020-12-31", "2021-12-31")
CF = c(-18965299.53, 18884929.89)
library(tvm)
xirr(CF, Dates, comp_freq = Inf)
= -0.004270912
versus -0.00423772 using Excel (the result does not match even if I modify comp_freq).
This is a simplified example but the discrepancy becomes bigger in other cases.
Does someone know how to adjust the formula so that it gives same result as Excel?
I know I can build my own code to calculate IRR, but I'd prefer to use this function, as I have a huge database with irregular daily cash flows.
Thanks