Excel XIRR Function returning invalid calculation - excel

When running the XIRR function "=XIRR(G163:G168,F163:F168)" where the cashflow is in G163:G168 and my dates are in F163:F168, excel is returning a value of .000000298023% which is definitely not correct. Any advise would be greatly appreciated!
9/13/2019 (2,137,500.00)
9/13/2019 (1,710,000.00)
9/13/2019 (35,331,814.80)
9/13/2019 (931,950.00)
9/13/2019 (14,990,988.60)
9/30/2020 45,757,426.80

The technique that Excel uses can return multiple values, depending on the initial assumption of rate. Since you left it unspecified, it assumes 10%.
If you add -10% as the optional guess argument, it will return 16.23%.
There are a couple of ways to come up with a reasonable guess if XIRR is giving a wrong answer, but here's one:
Negative 10% for negative values: 0.1*sign(sum(values))

The answer submitted by Ron Rosenfeld is accurate but there are more, subtle details I think are worth pointing out.
The 0.000000298023 value the asker identified as "definitely not correct" is a well known erroneous value produced by the Excel XIRR function. However, it is more commonly referred to as 2.98023E-09.
With reference to the official documentation, Jon Coleman commented that the first value is treated specially. This is a property of the concept more than Excel's implementation of the XIRR function; the first value usually represents something like a starting balance, which is also why the documentation says that value must be negative.
The last value usually represents a final balance and will have the oppposite sign of the first value. This is also a property of the concept, not the implementation.
Technically, the actual signs used don't matter but they must be used consistently throughout: one sign for inflows, the other sign for outflows. By convention, inflows are negative and outflows are positive.
The XIRR function sometimes has trouble with out-of-order values, though I don't have details on this.
Besides the first and last values, the XIRR function seems to handle multiple cash flows on the same date. Summing by date may still be beneficial for execution time (I don't know) but it will definitely be correct according to the equation.
In this instance, Excel can apparently be pointed in the right direction with a guess value of -10%. However, it follows from point #2 that splitting the "first" cash flow into multiple cash flows on the same day hinder's Excel's XIRR function. Indeed, with the dataset
2019-09-13 -55,102,253.40
2020-09-30 45,757,426.80
Excel's XIRR function determines the expected -16.23% without supplying a manual guess.
See also: Microsoft Community support question.

Related

Need proper formula to obtain correct value

It's my first question here. I need a formula which take the correct code at specific date. After taking correct code, excel table is using it for calculation of the correct value.
The concept is a little complicated. There is a calendar which is starting at 15.09.2021 (V3 Cell) and ending at 04.06.2022(JX3 Cell). And our codes are: ITB, OR, TBE, CBE, PO, VDR, SMF, FMF and DS. All of them are the steps of procurement process. And each of them has a specific values/coefficients like 0.1, 0.2, 0.15 etc and everyone comes true at specific date. And their locations are L2 to T2.
For example, we are taking the codes for procurement of generator at 15 September 2021:
=IF(V$3=$L5;$L$2;IF(V$3=$M5;$M$2;IF(V$3=$N5;$N$2;IF(V$3=$O5;$O$2;IF(V$3=$P5;$P$2;IF(V$3=$T5;$T$2;IF(V$3=$S5;$S$2;IF(V$3=$R5;$R$2;IF(V$3=$Q5;$Q$2;0)))))))))
L5 to T5 are the dates of procurement steps of that item.
And we are using same formula for other dates. It is working. But when, for example TBE and CBE completed at the same day, excel takes one of them (which is first). Sometimes 4-5 steps are completing at the same day. And for this situation, we can not take the true value of the item's procurement. We are calculating the progress of the procurement in that way. But as I said, it isn't working for the same dates. I tried to fix the formula by putting all possible combinations and giving them new code and coeffient:
=IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5;V$3=T5);$U$117;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5);$U$118;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5);$U$119;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$120;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5);$U$121;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5);$U$122;IF(AND(V$3=L5;V$3=M5;V$3=N5);$U$123;IF(AND(V$3=L5;V$3=M5);$U$124;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5;V$3=T5);$U$125;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5);$U$126;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5);$U$127;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$128;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$129;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5);$U$130;IF(AND(V$3=M5;V$3=N5;V$3=O5);$U$131;IF(AND(V$3=R5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=S5;V$3=T5);$U$132;IF(AND(V$3=R5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=S5);$U$133;IF(AND(V$3=R5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$134;IF(AND(V$3=N5;V$3=O5;V$3=P5);$U$136;IF(V$3=$L5;$L$2;IF(V$3=$M5;$M$2;IF(V$3=$N5;$N$2;IF(V$3=$O5;$O$2;IF(V$3=$P5;$P$2;IF(V$3=$T5;$T$2;IF(V$3=$S5;$S$2;IF(V$3=$R5;$R$2;IF(V$3=$Q5;$Q$2;0))))))))))))))))))))))))))))
New codes are at U117 to u152.
As it can be seen, it is so rough method to use. I tried to put every possible combination but also there is a character limit and i can't write all of them too.
I hope I could explain the problem well. Maybe it can be solved by VBA too.
I'll be glad if anyone helps for practical methods. Thanks.

What test can I use to calculate significance of optimization lift?

Given the following data for 12 users:
username, number of deals for control, revenue from test, revenue from control
Here's an example of how the data looks like
Can you help me figure out how I can calculate the significance of the hypothesis that the test is more profitable (preferably using excel)?
The measure I was thinking of using was the % of lift in revenues for each customer.
P.s. I have a background in statistics but not an expert so please keep it as simple as possible.
Since each pair of incomes refers to the same individual, you can perform a paired t-test.
Variable 1: Control income
Variable 2: Deals income
Then follow these instructions (copied here for posterity):
In Excel, click Data Analysis on the Data tab.
From the Data Analysis popup, choose t-Test: Paired Two Sample for Means.
Under Input, select the ranges for both Variable 1 and Variable 2.
In Hypothesized Mean Difference, you’ll typically enter zero. This value is the null hypothesis value, which represents no effect. In
this case, a mean difference of zero represents no difference between
the two methods, which is no effect.
Check the Labels checkbox if you have meaningful variables labels in row 1. This option helps make the output easier to interpret. Ensure
that you include the label row in step #3.
Excel uses a default Alpha value of 0.05, which is usually a good value. Alpha is the significance level. Change this value only when
you have a specific reason for doing so.
Click OK.
Alternatively, you can indeed calculate the difference between the two incomes, and then perform a one sample t-test (assuming that the difference is zero). However, such a test is not available out-of-the-box in Excel; the procedure is described here.

VBA (Excel) which average more precise, worksheetfunction or step-wise

I wrote a macro which as a tiny task on the side also calculates the average of around 39000 different values. I noticed that using WorksheetFunction.Average and calculating the average "step-wise" yield different results, but only at the 15th digit after the decimal point. By calculating "step-wise" I mean adding up each value to a total_sum variable, counting the amount of values in another variable and then dividing the former by the latter.
The 15th digit after the decimal point might be considered negligible but I find it unsettling nonetheless. Shouldn't those two values be exactly the same? They are when I use less values and as the macro might be applied on far more values than 39000 (100k+), I'm worried the error might increase.
So my questions are: What could cause the difference and more importantly which method is more precise?
What I tried was to declare all variables in the "step-wise" calculation as Variant to avoid using the wrong data type in any of those steps.
Thank you very much for your help!

Rate increase analysis, way to to calculate

Story that I need to go over auditors' note to provide feedback for all Provisions where Increase/Decrease > 20% line in Column H. Looking into provided doc I don't get how they calculate this e.g. = 1 - (RateOld / RateNew)
There nothing special behind those Rates, higher rate is better, and indicates better participation.
I need to be very careful before jumping into conclusion, don't want to mess with auditor's way. Anybody knows what is the logic/science/approach behind his formula, I pasted on the right more traditional ones I used.
Best
Thanks all, assume that they just switched new and old columns in provided sheet, so we divide by New Rate rather then Old. those formulas are same, first one always positive:
1-(G/D) = (D-G)/D
And logically this answers question how much change was last year, rather then This year.

Excel VBA: Solver does not seem to optimize "over time" using a date variable?

I have an optimization problem that I try to tackle with solver. Among others, one decision variable is a cell containing a date. Based on a time series, Solver should pick the optimum point in time. However, while it changes the other decision cells, it never changes this one! I even tried dropping the other decision variables (holding them constant) - still no change.
To help you have a lock into my problem, I created and attach an Excel sheet (here: download link) with a simplified problem, where from a time series of stock prices Solver should pick the date with the highest price. (I am aware that this particular problem could easily be solved with the MAX formula, but my real optimization problem is much more complex and wouldn't allow for this solution.)
Solver still doesn't change anything at the initial date value - even in this very simplified setting!
From a mathematical point of view, the present problem could be characterized as a (non-linear) step function, where particular points in time (on the x axis) correspond to different prices (steps, on the y axis).
Is there any tricks involved to get solver to handle time (date) values?
If you have luck to find the right set of Solver settings to make it get to the correct solution (which would be Jan 10, 2009), I'll be more than happy to hear about them.
Edit: I found out that non-linear problems with non-smooth discontinuous functions (like this problem, which is basically a staircase function) are generally difficult to tackle by any (non-)linear optimizer. Can someone savvy in the matter help me reformulate the problem in a solvable way. I found a similar topic on stack overflow with a suggested solution (see first answer), but don't know how to apply it to my problem.
Thanks,
Steve
I got your spreadsheet to solve in Excel 2010, by adding the constraint $C$7 >= $C$13, and using the Evolutionary Method. You can probably figure out the Math method you mentioned, but you may need to do it in VBA instead of the Solver dialog.

Resources