Random name generator without repeats?

Kaliwa

New Member
Joined
Jan 5, 2022
Messages
7
Office Version
  1. 2021
Platform
  1. Windows
Hi, I got a list of my employees from A1:A72, we got a game where in I need to display a single employee name without being repeated. So, that particular employee can perform the task.

Or to be more exact the list is already jumbled can I display a single employee name one after the other in that jumbled order?

Thank you,
Kaliwa
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I'd do something like this:
MrExcelPlayground6.xlsx
ABCD
1Employee 010.456825Employee 21
2Employee 020.422956Employee 71
3Employee 030.414224Employee 04
4Employee 040.07124Employee 59
5Employee 050.58179Employee 52
6Employee 060.854596Employee 62
7Employee 070.974352Employee 69
8Employee 080.746346Employee 29
9Employee 090.131006Employee 19
10Employee 100.985354Employee 09
11Employee 110.57414Employee 64
12Employee 120.993247Employee 47
13Employee 130.620336Employee 57
14Employee 140.768704Employee 50
15Employee 150.585094Employee 26
16Employee 160.547376Employee 63
17Employee 170.321011Employee 36
18Employee 180.517291Employee 23
19Employee 190.111907Employee 46
20Employee 200.322017Employee 25
21Employee 210.016081Employee 51
22Employee 220.455375Employee 32
Sheet4
Cell Formulas
RangeFormula
B1:B72B1=RANDARRAY(72)
D1:D72D1=SORTBY(A1:A72,B1#)
Dynamic array formulas.
 
Upvote 0
I'd do something like this:
MrExcelPlayground6.xlsx
ABCD
1Employee 010.456825Employee 21
2Employee 020.422956Employee 71
3Employee 030.414224Employee 04
4Employee 040.07124Employee 59
5Employee 050.58179Employee 52
6Employee 060.854596Employee 62
7Employee 070.974352Employee 69
8Employee 080.746346Employee 29
9Employee 090.131006Employee 19
10Employee 100.985354Employee 09
11Employee 110.57414Employee 64
12Employee 120.993247Employee 47
13Employee 130.620336Employee 57
14Employee 140.768704Employee 50
15Employee 150.585094Employee 26
16Employee 160.547376Employee 63
17Employee 170.321011Employee 36
18Employee 180.517291Employee 23
19Employee 190.111907Employee 46
20Employee 200.322017Employee 25
21Employee 210.016081Employee 51
22Employee 220.455375Employee 32
Sheet4
Cell Formulas
RangeFormula
B1:B72B1=RANDARRAY(72)
D1:D72D1=SORTBY(A1:A72,B1#)
Dynamic array formulas.
Thanks for the reply @JamesCanale !! Can you make it to one(single) display of emp so that if I click on F9 Or any other key for 72 times. I need all the employees names to be displayed without being repeated. I'm little bit new to excell...

Thank you
 
Upvote 0
Randarray is volatile, so any change will refigure the whole random array and you couldn't expect no repeats. I can't think of a good way to do what you want.
 
Upvote 0
I just wanna know @JamesCanale Can you think of a solution to display a single name one after the other in an order from 1-72??
 
Upvote 0
It's all in the details, but that would be an easy job for VBA. Something like take one item after another from a long list and put it in a specific cell and then do something - like print the form each time.
 
Upvote 0
Oh, thank you!! Will look into VBA then. Any heads up on what particular topic I should cover to know this work done.. Also... Thanks for all the replies @JamesCanale

Thanks,
Kaliwa
 
Upvote 0
It depends on what you want to do with these sheets when the new names get put into them. Print, email, create new sheets tabs for each person...

Otherwise, you need to be able to have VBA find the size of the array (or you can key it into the code), you'll need to make a loop, and access existing cells in excel.

Start with recording macros to see how VBA does things.
 
Upvote 0
If you put the RANDARRAY formula in B1 as shown, then manually sort columns A:B by column B, you won't need to worry about it resorting the list by a volatile function. Then to display the names one at a time, I'd suggest opening another sheet. Add a spin button. (Go to the Developer tab. If you don't see it, click File > Options > Customize Ribbon > check the Developer button on the right. Then on the Developer tab, click Insert > Spin Button (4th icon, top row). Use the mouse to "paint" it on the sheet where you want it. Then right click the button, select Format Control. Set the minimum value to 1, and the maximum value to 72. Pick a cell, like A1, for the Cell link. Then put this formula somewhere on that sheet:

Excel Formula:
=INDEX(Sheet1!$A$1:$A$72,A1)

Then as you click on the Spinner button, it will go through the list of names. This way you don't need VBA.

Hope this helps!
 
Upvote 0
Solution

Forum statistics

Threads
1,224,817
Messages
6,181,147
Members
453,021
Latest member
Justyna P

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