How can I get a random cell in OpenOffice Calc?

Stephen picture Stephen · Jun 5, 2011 · Viewed 8.7k times · Source

I've perused the Stack Exchange list of sites, and I can only think that SO is the right place to ask this (I saw a few excel questions, at least).

I have an array of values Sheet1.B3:B9. On another sheet, I'm trying to get a random value from one of those cells.

I suppose it has to be something with the RANK() function, but I'm grasping at straws.

How can I get the value of a random cell in that range?

Answer

JaviMerino picture JaviMerino · Feb 26, 2013

In LibreOffice Calc to get a random cell between cells B3 and B9 of Sheet1 you can do:

=INDEX(Sheet1.B3:B9, RANDBETWEEN(1,5))