All,

I am trying to calculate xirr from the tvm library. Provided below is a reproducible example :

```
# Reprex
# Attach desired packages
suppressPackageStartupMessages(library(tvm))
# Provide input data
CF <- c(-7500, 3000, 5000, 1200, 4000)
d <- as.Date(c("2016-01-01", "2016-02-01", "2016-04-15", "2016-08-01", "2017-03-26"))
# Call the XIRR Function
Res1 <- vector()
Res1 <- sapply(1:length(d), function(i) { tryCatch({ expr = xirr(i, CF[i:length(CF)],
d[i:length(d)])
}, error = function(i) { return(NA) })
})
# Print Results
print(Res1)
```

The code returns NA while the exact same data returns a valid value in Excel as shown here (https://www.techonthenet.com/excel/formulas/xirr.php) . Any guidance would be appreciated