You are on the right track. The main problem is that your parentheses are in the wrong place. But you have bigger problems than that so I'm going to make you start from scratch.
I highly recommend that you declare variables a, b, and c. Then your formula is much more readable, and easier to set up and debug. It will look exactly like the quadratic formula, in code form.
The quadratic formula gives two roots, but you have only calculated one of them. I am providing code to calculate both.
Your assignment to b has a syntax error. Remove the initial left parenthesis.
From context, it looks to me like c = ksp and a = 1. Never imply variables. If it's 1, then show a 1.
Here is the best practice for coding this:
Dim a As Double
Dim b As Double
Dim c As Double
Dim vt As Double ' no idea what this is
Dim xf As Double ' no idea what this is
Dim ksp As Double ' no idea what this is
Dim x1 As Double ' first root
Dim x2 As Double ' second root
a = 1
c = ksp
b = Range("C13") * Range("C14") / Range("C14") + vt * (xf - 1)
x1 = (-b + Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
x2 = (-b - Sqr(b ^ 2 - 4 * a * c)) / (2 * a)
Bookmarks