Can anyone please help me create a VBA function based on a math formula?
The idea is to create a function that uses linear interpolation to calculate an implied rate.
The equation is as follows:
Rn = R1 + [(R2 - R1)/(T2 - T1)] * (Tn - T1)
The variables are as follows:
Rn = Implied Rate (Between Two Positions)
Tn = Time Being Measured
R1 = Lower Bound Rate
R2 = Upper Bound Rate
T1 = Lower Bound Time
T2 = Upper Bound Time
We will be solving for Rn. It would also be interesting to see this formula re-arranged to be solving for Tn instead of Rn, but I'm more focused on the former.
I think this will be pretty easy for you guys, but it will definitely be useful and greatly appreciated by me!
Thank you so much,
Ben
The idea is to create a function that uses linear interpolation to calculate an implied rate.
The equation is as follows:
Rn = R1 + [(R2 - R1)/(T2 - T1)] * (Tn - T1)
The variables are as follows:
Rn = Implied Rate (Between Two Positions)
Tn = Time Being Measured
R1 = Lower Bound Rate
R2 = Upper Bound Rate
T1 = Lower Bound Time
T2 = Upper Bound Time
We will be solving for Rn. It would also be interesting to see this formula re-arranged to be solving for Tn instead of Rn, but I'm more focused on the former.
I think this will be pretty easy for you guys, but it will definitely be useful and greatly appreciated by me!
Thank you so much,
Ben