-1

I'm trying to calculate F-scores (using the formula 2 * a * b / (a + b)) in OpenOffice.org Calc, and would like a and b to be the previous two cells in the same row.

My problem is that while trying to define a function in OpenOffice.org Basic, I get an error that the ADDRESS and INDIRECT methods aren't defined.

How would you define a function that when run on a cell can refer to adjacent cells?

Edit: A bit of clarification. I'm actually looking for a way that if a function (let's call it F) is run in cell C1, the function automatically fetches the values from cells B1 and A1. Basically, calling =F() in C1 should return the result without my having to specify A1 and B1.

Also, if it could be run for a whole column, that would be helpful too.

MPelletier
  • 16,256
  • 15
  • 86
  • 137
Jory
  • 155
  • 6

1 Answers1

0

Cell values:

A1 1

B1 2

C1 =(2*A1*B1)/(A1+B1)

in C1 everything goes in, including the = sign. The = sign designates the contents of the cell as a formula.

jhamm
  • 1,858
  • 21
  • 19
  • Sorry. I realize your question was for a OO Basic function, but I am not familiar with OO Basic. I was able to come up with another set of formulas. I think formulas allow this solution to be more flexible. Cells: a b c 1 =SUM(A2:A3) =SUM(B2:B3) =(2*A1*B1)/(A1+B1) 2 1 2 3 1 2 The formulas in A and B can be extended to cover the whole column by changed the second number to the last row number of your column. Ex: if you have 525 records, A1 formula would be =SUM(A2:A525) Is there a specific reason to use a function rather than using formulas? – jhamm Jul 01 '09 at 13:46