How do I randomly select cells regardless of cell content?

L

Luke M

If you mean randomly find the value of a cell,
=INDEX(1:65536,INT(RAND()*65536),INT(RAND()*256))
Every time a calculation is performed, this will randomly pick a different
cell in the spreadsheet.

If you want an actual selection, you'll have to use VBA. If we knew more
about the goal/purpose, might be able to provide additional help.
 
B

Bernard Liengme

To randomly select a cell from the range A1:D10, use
=INDEX(A1:D10,RANDBETWEEN(1,10),RANDBETWEEN(1,4))

RANDBETWEEN need the Analysis Toolpac (except in XL2007), or you could use
best wishes
 
S

Shane Devenshire

Hi,

Careful with
=INDEX(1:65536,INT(RAND()*65536),INT(RAND()*256))

RAND generates a random number between 0 and 1. Suppose the result is
<=0.00001
INDEX(1:65536,0,0) is #VALUE!

Instead
=INDEX(1:65536,INT(RAND()*65535+1),INT(RAND()*255+1))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top