Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
[A LOT OF TEXT, MIGHT HOP TO "QUESTION" BELOW, sry] I use Iterations/Circular references to solve for a variable (basically, it is a yield-to-maturity finder and no, the Excel functions do not suffice). The circular reference is basically set up such that I 1. Enter a value, i.e. Price 2. I have a "static" start value 3. I have a "variable" which basically records the deviation to the start value to try (so that I am trying Start Value + Variable Value as YTM) 4. I calculate the Price based on the YTM as under 3 5. I calculate the difference between 4 and 1 6. I calculate a new YTM to try under 4 by changing the Variable Value under 3 based on the differnce in 5. (So basically I say Variable Value = Variable Value + Change, or e.g. in B10 I would have "=B10 + B11" and B11 would recede to zero after some iterations). I found that simply programming a circular, and thus have Excel make the guesses, caused it to be very slow and need many iterations. Therefore, I created the structure as above. I am trying to speed things up a bit further and to do that I am trying to debug the UDF I use (reason for using a UDF is to avoid issues with #VALUEs occuring in the circular structure due to other issues, sort of error handling which works great. I know that using a UDF probably slows things down and may get round doing it in Excel competely later). The UDF basically gets me a new YTM to use. I want to optimise the algortihm the get me he next guess therefor. QUESTION Now I can print.debug everthing I want except for one thing: The iteration sequence number it is currently working on. When it iterates, the statusbar will show "Iter: ##", and I want to print that number with the other debug values each time the UDF is called. Is there a way to do this? I would be satisfied if I could "read" the text in the statusbar and print that to the Immediate window, but I have not found a way to do it. [Geesh, that's a lot of text for a simple query, sry] |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2002: How to fill group of of odd number in sequence ? | Excel Discussion (Misc queries) | |||
Excel 2002: How to find 0.00 in a column of number? | Excel Discussion (Misc queries) | |||
Iteration problem (Excel 2002) | Excel Worksheet Functions | |||
How do I find the next higher number in a sequence? | Excel Discussion (Misc queries) | |||
How do I find a missing number in a sequence of numbers? | Excel Worksheet Functions |