Hi guys, I've been struggling with the following problem. Basically I have this equation:
EQUATION 1:
Formula:Please Login or Register to view this content.
Round is the usual excel function, VBA_CLng is a VBA defined CLng function (*definition at end). Now what I'm trying to do is that instead of the user giving B and D and then the excel calculating N, I want the user to give N and D, and the excel to back-calculate B. What I've done is:
EQUATION 2:
Formula:Please Login or Register to view this content.
This basically ignores the rounding and CLng operations. Most of the answers, from my analysis around 60% of the values between 1-8000 for N, come out correct - by correct I mean that if I take the B answer I calculate using N and D, and then go through the first equation I will get the same N that I provided initially. But in the rest of the cases, I will get errors between the given N and the one I re-calculate using the back-calculated value of B (not large errors, in the range of +/-5 - but still). How can I take the rounding process and CLng into account in Equation 2 such that I will eliminate such errors? (Also, please note that I absolutely have to round in the way it's done in the first equation - I can't put more of those operations together and Round fewer times)
Appendix*
Please Login or Register to view this content.
Bookmarks