Without knowing the ins and outs of what you're doing you will in essence need to utilise Events if you wish to use this type of approach (at least that's my belief).
The simplest solution would be store an independent copy of the "current" calculation output in another cell - ie a constant with no precedents.
If we use the simple example as outlined previously:
and choose to convert this to a UDF but avoid circular references you could do something along the lines of:
Called like so:
As you can see this is not goign to work at this point given we have nothing in N1 and are not referring to the current A1 result... this is where we use Events
The above event will fire after the UDF has been calculated - so post calculation the current result is stored as a constant in N1 thus the next time the UDF is invoked the value in N1 will be used as rngFalse - ie where the test fails and "current" result is to persist.
To be the best of my knowledge (which is limited) there's no way of doing the same, avoiding circular references using only functions be they native / UDF.
Bookmarks