Hi everyone,
I'd like to first thank everyone for helping me with understanding this VBA stuff, what you have seen is only a few of the questions I haven't been able to get, the majority I've been able to reason out on my own. However; I do have one final question that I have attempted, but am unable to solve. I have enclosed an image of the problem in a jpeg file.
It is a 3 stage decision tree with uniform probabilities given, and I need to write the macro that will work backwards and calculate the first value in the tree. Again, this is in the excel file.
Here's an exercise I did earlier to find expected value of a cell, but I'm having an extremely hard time adapting it.
CODE
Function valuex(i, j)
Dim pup
Dim pdown
pup = 0.6
pdown = 1 - pup
valuex = pup * Cells(i + 1, j + 1) + pdown * Cells(i - 1, j + 1)
End Function
Sub loopy()
'ctrl l runs this sub
Dim i
Dim j
Dim temp
i = 4
j = 1
temp = valuex(i, j)
Cells(6, 3) = temp
End Sub
Thanks in advance for any help that can be rendered, I really appreciate it.
Cheers
This post has been edited by m1_girard: 26 Feb, 2008 - 01:54 PM