Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function xPower(x As String)
' returns exponential value y raised to z power
' x has to be a string in format of number ^ number (4^2)
' y represents base number
' z represents exponent
Dim y As Double, z As Integer, i As Integer
i = InStr(1, x, "^", 1)
If i = 0 Then Exit Function
If IsNumeric(Left(x, i - 1)) Then
y = Left(x, i - 1)
Else
Exit Function
End If
If IsNumeric(Right(x, Len(x) - i)) Then
z = Right(x, Len(x) - i)
Else
Exit Function
End If
xPower = y
If z = 0 Then
xPower = 1
Exit Function
End If
For i = 2 To z
xPower = xPower * y
Next
End Function