Question

I have a column with 20000 numbers and I have to calculate the mean at intervals of 10 numbers. So I must have the mean for the first ten numbers, from 1-10, the mean for the elements (11-20) and so on.

How can I write a function which can do this task?

Was it helpful?

Solution

Another approach, tested with LibreOffice Calc: Create your formula for the first sample (first ten values), and then copy it as many times as you need it.

For example:

  1. To calculate the geometric mean of the first ten values (A1:A10), put the following formula into B5:

=GEOMEAN(A1:A10)

  1. Select cells B1:B10 (! - not only B5);

  2. Drag the selection down as far as you need.

LibreOffice will copy the formula from B5 to B15, B25 and so on, adapting the attribute range to B11:B20, B21:B30 and so on.

EDIT:

To filter out the empty cells from Column B, just add a header row and apply a AutoFilter with condition Not Empty. The result will look like this:

Mean - AutoFilter

OTHER TIPS

Create two columns next to the columns you would like to average. In the first column you type 0.1, 0.2, 0.3 etc. Just make sure you copy this all the way to the last row (100 or 20k). Then in the second column you put the formula =ceiling(column1samerow,1). The result is the following:

enter image description here

(example is from Excel as I do not have libreoffice; the ceiling function might be called slightly different e.g. ceil)

If you have the values you would like to average in column C then you create a pivottable with column B and C as data and you can proceed with that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top