Hi,

I have a polynomial chart that I want to add a formula to, however I am having trouble working out how to do it. I keep getting errors when I try it, Please note I am a excel rookie so set by step instructions would be appreciated

This is the link to the worksheet in question
https://jumpshare.com/v/70uXIRurCY4e...kGc3PL1Zp7SJ1i

The instructions I was given is as follows:

In the example, select F30:H31, paste

=Parabola(D29,E29, D30,E30, D31,E31)

... in the formula bar, press and hold the Ctrl and Shift keys, then press Enter.

The vertex is in F31 andG31.

Here's the code for the function:

Code:
Function Parabola(x1 As Double, y1 As Double, _
x2 As Double, y2 As Double, _
x3 As Double, y3 As Double) As Variant
' Given three points, returns the coefficients, vertex, and focus
' of the parabola y = Ax^2 + Bx + C:
' A B C
' Vx Vy Fy
' Note that Fx = Vx

Dim d As Double
Dim A As Double
Dim B As Double
Dim C As Double
Dim Vx As Double
Dim Vy As Double
Dim Fy As Double

d = (x1 - x2) * (x1 - x3) * (x2 - x3)
A = (x3 * (y2 - y1) + x2 * (y1 - y3) + x1 * (y3 - y2)) / d
B = (x3 * x3 * (y1 - y2) + x2 * x2 * (y3 - y1) + x1 * x1 * (y2 - y3)) / d
C = (x2 * x3 * (x2 - x3) * y1 + x3 * x1 * (x3 - x1) * y2 + x1 * x2 * (x1 - x2) * y3) / d

Vx = -B / (2# * A)
Vy = C - B * B / (4# * A)
Fy = Vy + A / 4#

Parabola = Array(Array(A, B, C), Array(Vx, Vy, Fy))
End Function


Copy the function from the post, do Alt+F11 to open the VBE, Insert > Module, and paste the code in the window that opens.