Entering complex formulas in Calc

I am trying to add a formula on a worksheet in Calc. It is a complex formula, and I have tried all kinds of ways to enter it but none of them work - I always get an “invalid argument” error or something like that. It is the formula for calculating the volume of a substance (usually a liquid) in a tank (cylinder) of a certain radius and height.

Here is the formula (as I understand it)

 L(R^2 cos-1 ((R-D)/R) - (R-D) sqrt(2RD-D^2)

R is the radius of the cylinder.
D is the depth.
L is the length of the cylinder

That is the best I can do on the formula, as this text editor doesn’t have some ways (that I can see) to express some things in the formula (squared, square root, cos-1 is actually cos^-1 [I think], etc). I hope it is not forbidden to post links to something in a question post, I am going to have to hope it isn’t — so that anyone reading this that might know how to set up this formula can look at it and give me some help.
link text.

I knew that R D and L would have to have their own cells, and did that. I thought maybe cos needed to be worked separately in it’s own cell, so I did that. And I figured maybe the square root would need to be done in it’s own cell so I did that. Still no luck. Always get the error. Any help that someone could give me on this would be greatly appreciated. Thanks!



Radius in cell B3
Length in cell B4
Depth in cell B5 (I’d call this fill height or liquid height)

then the formula is:

=B4*(B3^2*ACOS(1-B5/B3)-(B3-B5)*SQRT(2*B3*B5-B5^2)) where I set (R-D)/R = 1-R/D)

See also the following sample file: Cylinder.ods

Please note The sample file or its formula doesn’t contain any checking (e.g. Depth must not be grater than 2**Radius*)

Hope that helps.

That worked great Opaque! Many thanks