XIRR is the name of an Excel function.Please explain what XIRR means and use meaningful titles so that we avoid wasting time opening threads we do not understand. thc
I am trying to do XIRR computation in attached file.
1. I have put formula in I3.
2. This should not take empty cells into consideration
3. It should match C3 with C11:C52
=TRANSPOSE(UNIQUE(FILTER(C11:C52,C11:C52<>"")))
=UNIQUE(FILTER(D11:D52,D11:D52<>""))
=SUMPRODUCT(($C$11:$C$52=P$10)*($D$11:$D$52=$O11),($G$11:$G$52))
=XIRR(INDEX(P11:p15,MATCH(TRUE,P11:p15<>0,0)):INDEX(P11:p15,ROWS(P11:p15)),INDEX($O11#,MATCH(TRUE,P11:p15<>0,0)):INDEX($O11#,ROWS(P11:p15)))
=(MAX($O11#)-INDEX($O11#,MATCH(TRUE,P11:p15<>0,0)))/365
=(1+P20)^P21-1
= MAP(reportFund, MyXIRR)
where MyXIRR(fund) is a Lambda function with the formula
= LET(
fundDetails, FILTER(investmentDetails, investmentFund=fund),
fundDates, TOCOL(CHOOSECOLS(fundDetails, 1, 7),,1),
fundValues, TOCOL(CHOOSECOLS(fundDetails, 4, 6),,1),
XIRR(fundValues, fundDates, -20%)
)
Using Excel 365 I got numbers from
View attachment 83215Code:= MAP(reportFund, MyXIRR) where MyXIRR(fund) is a Lambda function with the formula = LET( fundDetails, FILTER(investmentDetails, investmentFund=fund), fundDates, TOCOL(CHOOSECOLS(fundDetails, 1, 7),,1), fundValues, TOCOL(CHOOSECOLS(fundDetails, 4, 6),,1), XIRR(fundValues, fundDates, -20%) )
@The Village Idiot
Unlike me, you appear to know something about the implementation of XIRR. Is it simply a case of converting the resulting annual rate to a daily rate or is something more subtle involved?
Thank you for such a clear explanation. I will remember that for future use.Very nice! That is clean. Well done. My numbers match yours.
For rates of return, the general convention is to provide the holding period return (not annualized) for periods of less than one year, and to annualize for periods greater than one year. The reasoning is that if you annualize for periods less than one year, you are projecting/implying growth rates into the future whereas for periods of greater than a year, you are basically reporting a one year average return over the [multi-year] period.
In this case, the results are over 6 days, so to infer a yearly return over six days is basically compounding 60 times, and is unlikely to come to fruition.
Since XIRR is always annualized, we have to find the 6 day return (geometric, not arithmetic). (1 + XIRR)^(days/days_in_year)-1.
You can then turn it to an average daily return, but that should be specified if you do so.
= LET(
securityDetail, TAKE(Table1,,3),
distinctSecurity, UNIQUE(securityDetail),
distinctIRR, BYROW(distinctSecurity, myXIRR),
HSTACK(distinctSecurity, distinctIRR)
)
myXIRR(selectedSecurity)
= LET(
securityDetail, TAKE(Table1,,3),
filterCriterion, BYROW(securityDetail = selectedSecurity, LAMBDA(b, AND(b))),
singleSecurity, FILTER(Table1, filterCriterion),
dates, TOCOL(CHOOSECOLS(singleSecurity,4,6)),
amounts, TOCOL({-1,1}*CHOOSECOLS(singleSecurity,5,7)),
XIRR(amounts, dates)
)