(Old) Rand Between Multiple Lists With No Duplicates

Sansao

New Member
Joined
Mar 23, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone!
Following the old post (Rand Between Multiple Lists With No Duplicates).

Is it possible to make it for two lines at the bottom?
We generate the names on the line 20. How can I create a new sort in line 21 without duplicating the names of the same column in line 20 and not duplicating the names of the line 21?

Example: If "Cat" is in B20, how can i keep it from beeing "Cat" again in B21 and also not duplicate "Cat" in line 21?

example.png


I'm using this:

RangeFormula
Cell Formulas
A20A20=IFERROR(INDEX(A$3:A$17,RANDBETWEEN(1,COUNTA(A$3:A$17)),1),"")
B20:D20B20=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B$3:B$17)/(COUNTIF($A20:A20;B$3:B$17)=0)/(B$3:B$17<>""),RANDBETWEEN(1,SUMPRODUCT(--(B$3:B$17<>""),--(COUNTIF($A20:A20;B$3:B$17)=0))))),"")
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Could you insert a new blank column A then you could use the same formula dragged to all cells (Assuming that I have interpreted correctly)

22 03 24.xlsm
ABCDE
1
2
3catchihuahuadogdragon
4dogsalmonmousedingo
5iguanaparrotgiraffewolf
6parrotcatowlsalmon
7mousebearmouse
8chihuahua
9
10
11
12
13
14
15
16
17
18
19
20dogcatbeardingo
21parrotchihuahuagiraffewolf
Rand
Cell Formulas
RangeFormula
B20:E21B20=LET(f,FILTER(B$3:B$17,(B$3:B$17<>"")*ISNA(MATCH(B$3:B$17,B19,0))*(ISNA(MATCH(B$3:B$17,$A20:A20,0)))),INDEX(f,RANDBETWEEN(1,ROWS(f))))
 
Upvote 0
Solution
Hi, Peter!
Thanks very much for your reply and help.

Well, your example looks fine, but actually, over time, it starts to duplicate values in the line and in the column, as you can see in the image below. That's what I don't want to happen. I applyed the formula you gave me in the range B20:E21


example 1.png
 
Upvote 0
Are you sure that you applied the formula correctly and without alteration?
I have just run a macro to recalculate my test worksheet 10,000 times and check for duplicates each time. It showed no duplicates.

Copy/Paste my B20 formula into your B20 then drag the formula across and down.

If you are still getting that can you post your sheet with XL2BB as we cannot tell much at all from a picture.
 
Last edited:
Upvote 0
As another double-check, start a new blank worksheet.

Copy my sample from post #3 by clicking this icon
1648122685335.png
at the top-left of my mini-sheet

Then select cell A1 in your new blank worksheet and Paste
Press F9 to recalculate repeatedly.
 
Upvote 0
Dear Peter,

You were right, the excel formula translator was making a mistake that I indentifyed and corrected. After that, everything worked perfectly.

Thank you so much for you time and help!

Wish you all the best! :D
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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