You can create a cell function like that yourself if you want to, using
OpenOffice.org Basic, for example.

Click:
Tools->Macros->Arrange macros->OpenOffice.org Basic...
In the "Macro from" dialog, double click My Macros, then Standard, then
Module 1. Then click Edit.

Now a window opens with the following text (if no macros were added
previously):

REM ***** BASIC *****

Sub Main

End Sub


Replace that text with the following:
REM ***** BASIC *****
OPTION EXPLICIT

Function root(x As Double, y As Double) As Double
   root=x^(1/y)
End Function

Maybe you also want to change the name of Module1 to something more
describing, like MyCellFunctions or something quite different. Just right
click the Module1 tab and then click rename and so on.

Now, you can enter the following in a cell in any spreadsheet on your
system:
=root(9;2)
The result is 3 since 9^(1/2)=3.

If you prefer to have it the other way around, that root(2;9), then just
change the function slightly:
REM ***** BASIC *****
OPTION EXPLICIT

Function root(x As Double, y As Double) As Double
   root=y^(1/x)
End Function


Just remember that, when creating your own cell functions, never use names
of existing cell functions, if you're not a fan of error messages, that is.

Regards


Johnny

Reply via email to