View Single Post
  #2   Report Post  
Morrigan
 
Posts: n/a
Default


With 2 helper columns, you can try something like this:

A3:A20 = your data

B3 = IF(A3=0,500,ROW()) (Copy down)
C3 = SMALL(B$3:B$20,ROW()-2) (Copy down)

D3 =
OFFSET(A3,INDIRECT("C"&RANDBETWEEN(ROW(),ROW()+COU NTIF(C3:C20,"<500")-1))-ROW(),0)


Hope this helps.



kathyxyz Wrote:
I have a list of twenty real number in A1 to A20.
How can I randomly select a number from the list, but not the one with
value = 0
If the selected number is zero, it will automatically select another
random number from the list.
The list is dynamic, so I don't know exactly when and where the ones
with zero value show up.
Thank you.

Katherine.



--
Morrigan
------------------------------------------------------------------------
Morrigan's Profile: http://www.excelforum.com/member.php...fo&userid=7094
View this thread: http://www.excelforum.com/showthread...hreadid=390385