Is it the formula in C24 with the problem?
If it is the problem is a type mismatch caused by 'Psi 0' being passed to the function for the psi argument.
In the formula you refer to C$23, but in the other formulas in that row/area you refer to C$22.
Changing to C$22 doesn't quite fix things - the formula still return's #VALUE! but it seems to get further on in the function's code.
The next problem is this.
According to the watch window s_w is a range with one cell, so I'm not sure what you are trying here.
Also, even if it was a larger range targetCost-costUpperBound returns -20000, which I don't think you can use as an index - if that was the intention.
I was wondering if the problem here is a simple typo, in the rest of the code you have this sort of thing.
If I add the * in, and change the formula on the worksheet to this,
the formula returns 887,500 instead of an error.
Bookmarks