pedrosc
04-25-2020, 02:49 AM
Hello Folks,
I am trying to write a function that writes a code to calculate the volume of a cone. The function seems alright to me but when using it on excel I keep getting the error #NAME? . I know this must be very basic but can you please help me fixing this? The code is below...
Function vcone(r As Double, h As Double) As Double
Dim pi As Double
pi = 4 * Atn(1)
vcone = 1 / 3 * pi * r ^ 2 * h
End Function
I am trying to write a function that writes a code to calculate the volume of a cone. The function seems alright to me but when using it on excel I keep getting the error #NAME? . I know this must be very basic but can you please help me fixing this? The code is below...
Function vcone(r As Double, h As Double) As Double
Dim pi As Double
pi = 4 * Atn(1)
vcone = 1 / 3 * pi * r ^ 2 * h
End Function