Randomly Select Based on a value of another Cell

manny805

New Member
Joined
Jun 3, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello-

Trying to create a formula that randomly selects a tracking ID for each associate. In addition, make an alternate selection, but it can't be a duplicate of first random selection. Was thinking a VLOOKUP & RANDBETWEEN combo, but stumped. Not sure if I have to go through VBA route?

Any suggestions would be appreciated. Sample workbook attached.

Regards,
Manny


Random_Selection.xlsx
BCDEFG
3
4AssociateTracking IDAssociateRandom Tracking ID SelectionAlternate Random Tracking ID Selection (can't be a duplicate of previous slection)
5Smith, MaryTRK65152Smith, Mary
6Smith, MaryTRK74183Jones, Walter
7Smith, MaryTRK35154Williams, Tony
8Smith, MaryTRK23117
9Smith, MaryTRK11889
10Jones, WalterTRK17364
11Jones, WalterTRK91736
12Jones, WalterTRK88234
13Jones, WalterTRK80012
14Jones, WalterTRK55874
15Williams, TonyTRK58142
16Williams, TonyTRK47336
17Williams, TonyTRK13254
18Williams, TonyTRK28596
19Williams, TonyTRK33371
20
Random_Selection
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEF
1
2AssociateTracking IDAssociateRandom Tracking ID SelectionAlternate Random Tracking ID Selection
3Smith, MaryTRK65152Smith, MaryTRK35154TRK74183
4Smith, MaryTRK74183Jones, WalterTRK88234TRK91736
5Smith, MaryTRK35154Williams, TonyTRK58142TRK28596
6Smith, MaryTRK23117
7Smith, MaryTRK11889
8Jones, WalterTRK17364
9Jones, WalterTRK91736
10Jones, WalterTRK88234
11Jones, WalterTRK80012
12Jones, WalterTRK55874
13Williams, TonyTRK58142
14Williams, TonyTRK47336
15Williams, TonyTRK13254
16Williams, TonyTRK28596
17Williams, TonyTRK33371
18
Summary
Cell Formulas
RangeFormula
E3:F5E3=LET(Fltr,FILTER($B$3:$B$17,$A$3:$A$17=D3),INDEX(SORTBY(Fltr,RANDARRAY(ROWS(Fltr))),{1,2}))
Dynamic array formulas.
 
Upvote 0
Solution
WOW!! Thank you! Exactly what I was looking for.

Take care,
Manny
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,867
Messages
6,175,074
Members
452,611
Latest member
bls2024

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