View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
jlclyde jlclyde is offline
external usenet poster
 
Posts: 410
Default How to random pick a cell from more than one column

On Jan 6, 1:15*pm, fruitchunk
wrote:
I know how to pick a random cell from one column
=INDEX($A:$A,RANDBETWEEN(1,COUNTA($A:$A)),1)

but I need to pick a random cell from more than one column, I tried this:
=INDEX($A:$F,RANDBETWEEN(1,COUNTA($A:$F)),1)
but it doesn't work.

I tried searching the other posts but I couldn't figure it out.
Please help, Thanks.



This will not pick the cell for you but it will tell you what the
value is in that cell. The counta I was guessing were column and row
headers.

=INDEX(A2:F7,RANDBETWEEN(2,COUNTA(A2:A7)),RANDBETW EEN(1,COUNTA
(A2:F2)))

Jay