Random Data with No Blanks and No Duplicates

HoneyBadger914

New Member
Joined
Aug 14, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I am looking for a way to pull a random piece of data from a table, and skip the blanks and ensure there are no duplicates. The farthest I have gotten is by using <=INDEX('Sheet 1'!E8:G68,RANDBETWEEN(1,ROWS('Sheet 1'!E8:G68)),1), but this formula pulls the empty boxes. Not sure if this will pull duplicates, I haven't seen any yet. Thanks in advance!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Not something that I've tried (I don't personally have office 365 to test the filter function) but one that comes to mind

=INDEX(FILTER('Sheet 1'!$E$8:$E$68,'Sheet 1'!$E$8:$E$68<>""),RANDBETWEEN(1,COUNTIF('Sheet 1'!$E$8:$E$68,"?*")))

You might need to enter it as a legacy array by using Ctrl Shift Enter to prevent it from trying to spill.
 
Upvote 0
Hi HoneyBadger914,

Your formula should work though you'll need to add a randomization for columns also, e.g.
=INDEX($E$8:$G$68,RANDBETWEEN(1,ROWS($E$8:$E$68)),RANDBETWEEN(1,COLUMNS($E$8:$G$8)))

Yes, this will produce duplicates. Approximately 50% of the time you'll get a duplicate by the 10th execution.

I can only think of a kludgy way of addressing this with multiple work columns, I've only got Excel 2016, so probably @jasonb75 has the better approach.
 
Upvote 0

Forum statistics

Threads
1,213,533
Messages
6,114,179
Members
448,554
Latest member
Gleisner2

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