Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How do I randomly select cells regardless of cell content?

I'm attempting to unconditonally and randomly select cells in a spreadsheet
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default How do I randomly select cells regardless of cell content?

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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"gmadden2" wrote:

I'm attempting to unconditonally and randomly select cells in a spreadsheet

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default How do I randomly select cells regardless of cell content?

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))

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire

"Luke M" wrote in message
...
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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"gmadden2" wrote:

I'm attempting to unconditonally and randomly select cells in a
spreadsheet


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default How do I randomly select cells regardless of cell content?

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
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"gmadden2" wrote in message
...
I'm attempting to unconditonally and randomly select cells in a
spreadsheet



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
randomly select a cell from an array TLC Excel Discussion (Misc queries) 7 April 22nd 23 07:43 PM
what can I do to randomly select cells that contain text? gmadden2 Excel Worksheet Functions 2 January 6th 09 05:58 PM
How do I randomly select a cell without replacement? CT_Jim Excel Discussion (Misc queries) 2 February 27th 08 07:00 PM
does ctrl f select cells randomly? tc Excel Discussion (Misc queries) 3 August 23rd 07 11:26 PM
Truncation of content/detail randomly oursmp Excel Discussion (Misc queries) 0 September 9th 05 08:48 AM


All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"