Public Function vertex(a, b, c) back1 = b^2 - (c * (a * 2)^2) back2 = (a * 2)^2 tempGCF = gcf(back1, back2) back1 = back1/ (-tempGCF) back2 = back2 / tempGCF If back2 < 0 Then back1 = -back1 back2 = -back2 End If tempGCF = gcf(b, a * 2) b1 = b / tempGCF b2 = a * 2 / tempGCF If b2 < 0 Then b1 = -b1 b2 = -b2 End If answerstring = a & "(x + " & b1 & "/" & b2 & ")^2 + " & back1 & "/" & back2 answerstring = Replace(answerstring, "+ -", "- ") answerstring = Replace(answerstring, "/1)", ")") If Right(answerstring, 2) = "/1" Then answerstring = Left(answerstring, Len(answerstring) - 2) If Left(answerstring, 2) = "1(" Then answerstring = Right(answerstring, Len(answerstring) - 1) If Left(answerstring, 3) = "-1(" Then answerstring = "-" & Right(answerstring, Len(answerstring) - 2) vertex = answerstring End Function