# Is it possible to make a lottery on Excel?

Copper Contributor

# Is it possible to make a lottery on Excel?

We have a list of 10 names, and we need to randomly select a name to be the winner for the first month. Then, for the second month, we need to pick another winner, but it should not include the winner from the first month. Can you help with setting this up?

4 Replies

# Re: Is it possible to make a lottery on Excel?

If your list of names in the lottery pot is in cells A2:A11, the following formula will randomize the list of names.

``=INDEX(A2:A11,SORTBY(SEQUENCE(10),RANDARRAY(10)))``

I hope this helps you.

# Re: Is it possible to make a lottery on Excel?

For random selection excluding prior winners (random selection without replacement), see the attached workbook.

# Re: Is it possible to make a lottery on Excel?

Try this. List your names in A1:A10. Then in another cell, say C1, enter this formula:
=INDEX(SORTBY(A1:A10, RANDARRAY(ROWS(A1:A10))), SEQUENCE(10), {1})

# Re: Is it possible to make a lottery on Excel?

It is not comprehensible for me to call your solution the best.

Your formula is cumbersome and unnecessarily complicated.

This one does too:

``=SORTBY(A2:A11,RANDARRAY(10))``

I also used INDEX() unnecessarily in my first answer. You don't need it at all.