| View previous topic :: View next topic |
| Author |
Message |
rtj Newbie

Joined: 02 Sep 2004 Posts: 2 Location: UK
|
Posted: Thu Sep 02, 2004 6:36 pm Post subject: How to get a random cells txt contents into another cell...? |
|
|
Ok, bit of background info:
A5 to A10... each cell contains a word.
What I want to do is RANDOMLY take a cell between A5 and A10, copy that text, and paste it into another cell (say B10).
What would be the easiest way to do it?
Also how do i 'refresh' (for want of a better word) the page to randomly choose another cell between A5 and A10 to paste into B10?
Any help would be greatly appreciated.
I've been searching Google all day for the answer to the first question!
All the best,
RT |
|
| Back to top |
|
 |
richhill OOo Advocate


Joined: 16 Jun 2004 Posts: 418 Location: Mesa, AZ
|
Posted: Thu Sep 02, 2004 8:40 pm Post subject: |
|
|
B10 =INDEX(A5:A10;INT(RAND()*5)+1) _________________ OOo Calc tips: http://www.openofficetips.com
Last edited by richhill on Sun Sep 12, 2004 7:36 pm; edited 1 time in total |
|
| Back to top |
|
 |
rtj Newbie

Joined: 02 Sep 2004 Posts: 2 Location: UK
|
Posted: Fri Sep 03, 2004 5:34 am Post subject: |
|
|
Hi richhill,
Thank you SO much for that formula, it works a treat.
many thanks
RT |
|
| Back to top |
|
 |
David Super User


Joined: 24 Oct 2003 Posts: 5668 Location: Canada
|
Posted: Fri Sep 03, 2004 5:56 am Post subject: Re: How to get a random cells txt contents into another cell |
|
|
| rtj wrote: | Ok, bit of background info:
A5 to A10... each cell contains a word.
What I want to do is RANDOMLY take a cell between A5 and A10, copy that text, and paste it into another cell (say B10).
What would be the easiest way to do it?
Also how do i 'refresh' (for want of a better word) the page to randomly choose another cell between A5 and A10 to paste into B10?
Any help would be greatly appreciated.
I've been searching Google all day for the answer to the first question!
All the best,
RT |
You received a fine answer [much neater for your purpose], but it brought to mind another technique, so for what it's worth I thought I'd throw it in. It is useful if preparing something like random bingo cards.
Suppose you have a list in column A. In column B, opposite each, have the formula =RAND(). You can copy formulas by dragging of course. F9 will give fresh values any time. Then do a Data Sort using column B, and you get incidentally a random distribution of column A, which you can use anywhere else needed for that purpose.
David. |
|
| Back to top |
|
 |
|