Coaches Random Numbers

GomaPile

Active Member
Joined
Jul 24, 2006
Messages
334
Office Version
  1. 365
Platform
  1. Windows
Hello all,

Can someone help please. We have a school soccer team where we draw numbers out of a bag, who goes first lower to highest or odds & even etc... Found this formula that works well for our school soccer team.

What Im trying to achieve using my random personal numbers, after pressing F9 multiple times some of Cells have repeated with the same value more than once, where I would prefer 3 random unique numbers everytime.

The formula below is copied 3 times with the same info across 3 separate cells from A1), B1), C1)

=INDEX(K1:K10, RANDBETWEEN(1, COUNT(K1:K10)), 1)

My list of personal Coaches Random Numbers in Cells K1:K10 downwards, and no 2 numbers are displayed with same value, every number is unique.

We appreciate anyone's support

Kind Regards
Nasa2
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try this:

Book1
ABCK
1K01K06K07K01
2K02
3K03
4K04
5K05
6K06
7K07
8K08
9K09
10K10
Sheet1
Cell Formulas
RangeFormula
A1:C1A1=LET(a,RANDARRAY(ROWS(K1:K10)),TRANSPOSE(FILTER($K$1:$K$10,a>=LARGE(a,3))))
Dynamic array formulas.
 
Upvote 1
Hey [COLOR=rgb(110, 146, 115)]Phuoc[/COLOR],

A quick thank you with your response & support. We added your formula below but it didn't work, it returned #NAME? error in cell A1.

=LET(a,RANDARRAY(ROWS(K1:K10)),TRANSPOSE(FILTER($K$1:$K$10,a>=LARGE(a,3))))

 Nasa2
 
Upvote 0
Are you using O365 or another version?

Book1
ABCK
1K03K08K10K01
2K02
3K03
4K04
5K05
6K06
7K07
8K08
9K09
10K10
Sheet1
Cell Formulas
RangeFormula
A1A1=INDEX($K$1:$K$10, RANDBETWEEN(1, ROWS($K$1:$K$10)))
B1:C1B1=INDEX($K$1:$K$10,LARGE(ROW($K$1:$K$10)*(COUNTIF($A$1:A1,$K$1:$K$10)=0),RANDBETWEEN(1, ROWS($K$1:$K$10)-ROWS($A$1:A1))))
 
Upvote 0
Hey mate (@Phuoc),

Thanks again. Yes I'm using Office 365 sorry should have mentioned that earlier.

We're half way there!! What I mean by that statement the first two formulas works well. I copied the second code in both cells B1 & C1 however it repeated the same value multiple times in B1 & C1, but NOT in A1

One result came back with.
A1) 3
B1) 8
C1) 8

And I double and triple checked every F9 to make sure.

Nasa2
 
Upvote 0
Maybe something like this?

Libro1.xlsx
AB
1Random number from 1 to:20
2Size of result array3
3
4Result array11
515
616
Hoja2
Cell Formulas
RangeFormula
B4:B6B4=LET(n, B1, rand,HSTACK(RANDARRAY(n),SEQUENCE(n)), TAKE(DROP(SORT(rand,1),,1),B2))
Dynamic array formulas.
 
Upvote 0
Or maybe this? I don't know if I understood correctly
(in K1:K10 you can enter the coach numbers you want)

Libro1.xlsx
ABCDEFGHIJK
16157298
282
32
458
55
672
73
861
98
1063
Hoja2
Cell Formulas
RangeFormula
A1:C1A1=LET(cn, $K$1:$K$10, rand,HSTACK(RANDARRAY(ROWS(cn)),cn), TRANSPOSE(TAKE(DROP(SORT(rand,1),,1),3)))
Dynamic array formulas.
 
Upvote 0
If you're getting a #NAME? error, that likely means that your version of Excel doesn't recognize one of the functions in that formula. Are you sure that you're using Excel 365? If so, do you know when it was updated last?

Here are a couple versions using older functions:

Book1
ABCDEF
1ResultsList
23651371
32
4201310753
54
65
76
87
98
109
1110
12
Sheet3
Cell Formulas
RangeFormula
B2:D2B2=INDEX(SORTBY(F2:F11,RANDARRAY(10)),{1,2,3})
B4:D4B4=AGGREGATE(14,6,$F$2:$F$11/(COUNTIF($A4:A4,$F$2:$F$11)=0),RANDBETWEEN(1,COUNT($F$2:$F$11)-COLUMNS($B:B)+1))
Dynamic array formulas.


The B2 formula uses functions available in Excel 2021.

THe B4 formula uses functions available in Excel 2013. SInce that version doesn't SPILL results, you have to drag the formulas. Also, it's required to have a cell to the left (A4 here) which does not have any of the F2:F11 values in it. Also, the F2:F11 values must be numbers. If you want text, that's possible too, but I'll have to adjust the formula.
 
Upvote 0
Hey mate,

Yes definitely using Office 365 here.

And WE tried again using your first post formula on other Office pc's and all came back with #NAME? error.

However your 2nd post formula actually worked brilliantly, thank-you so much!!


Also, you mentioned it's possible to add text too with numbers... that's awesome. You read my mind, cos we were discussing that yesterday thinking having a mystery prize for our little soccer league.

Let me discuss this further with my team whether we need this option. I'll get back to you soon.

Anyway we're sooo happy that the formula returns with different numbers it's make our job easier now.

Thanks
Nasa2
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,201
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top