Announcement: Important message regarding Site Behaviour and Terms of Use. Click here to read.
|
VBA experts? Binary chop VBA code for excel
|
|
|
|
NoDo$h
Joined: 02 May 2006
Location: wear the fox hat?
Posts: 6532

|
| VBA experts? Binary chop VBA code for excel |
|
Excel's =XIRR is all very well, but it uses an iterative methodology to ascertain the "best fit" answer. I need to carry out a similar calculation, but using the bisection method (binary chop) to provide a test model for a piece of software that's being implemented by my client. None of the standard excel anaylsis toolkit use the binary chop, so the model I've put togther is only a close fit (within 0.03%) when I need to be closer to 6 decimal places with the accuracy.
The software partner is being suitably cagey and will only offers us fragments of their code and my VBA knowledge (to build a calc engine in excel for testing) is..... nil.
Anyone out there had a read of this and now nodding sagely as opposed to wondering what the hell I'm drinking tonight? All suggestions welcome. Carbon footprint? I neither know nor give a damn
DISCLAIMER: If you find a posting or message from me offensive, inappropriate, or disruptive, please ignore it. If you don't know how to ignore a posting, complain to me and I will be only too happy to demonstrate.
|
Mon Oct 06 2008 8:45pm |
|
|
DG
Site Moderator
Joined: 12 Dec 2005
Location: In the pubic domain !
Posts: 15105

|
f(x) = x^3 + .25x^4
g(x) = x + 2x*cos(x^2)
x^3 + .25x^4 = x + 2x*cos(x^2)
x=0
-6*cos(x^2)+x^3+4*x^2-4=0
Insert that into a speadsheet and name a cell x
Now you use GoalSeek from the tools menu
and let that set the cell with the formula to zero by changing the cell named x
Well ...it sounds plausible to me Powered by TorqTune
In three words I can sum up everything I've learned about life: .................It goes on.
Last edited by DG on Mon Oct 06 2008 9:06pm; edited 1 time in total
|
Mon Oct 06 2008 8:55pm |
|
|
JMC
Joined: 25 Feb 2006
Location: Aberdeen-Angus. Where the Bull* comes from!
Posts: 4162

|
Don't know if you've been drinking but it reads like you need a good whisky and some fuzzy logic The older I get, the more I realise that people confuse wrinkles for wisdom
|
Mon Oct 06 2008 8:55pm |
|
|
NoDo$h
Joined: 02 May 2006
Location: wear the fox hat?
Posts: 6532

|
er, thanks and thanks
If I put that lot in tomorrow and end up with porn..... I know where you live DG! Carbon footprint? I neither know nor give a damn
DISCLAIMER: If you find a posting or message from me offensive, inappropriate, or disruptive, please ignore it. If you don't know how to ignore a posting, complain to me and I will be only too happy to demonstrate.
|
Mon Oct 06 2008 9:05pm |
|
|
SN
Joined: 03 Jan 2006
Location: Doing the Lambeth Walk
Posts: 7518

|
Too hard for half eleven on a monday night - i've written (super efficient) binary chop code in VB5/6 in the (now dimming) past but searching my personal archive (old 40Gb USB Drive) hasn't revealed anything useful... unless you want some massive tranches of "3D universe" manipulating code ... sorry
Can't believe I managed to write all that really complicated stuff many years ago Steve N | 2006 TDV6 S Auto in Buckingham Blue | Member of the top ten club | Am I online?
|
Mon Oct 06 2008 10:31pm |
|
|
|
|
Posting Rules
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|