Select different numbers from indipendent lists efficiently

Status
Not open for further replies.

NightCa

New Member
Joined
Apr 24, 2023
Messages
18
Office Version
  1. 2021
Platform
  1. Windows
Hello everybody. I'm looking for a volatile UDF that selects a random entry from every column in a given range so that every selected value is unique. The same numbers can appear in multiple columns, but not more than once in a column. As i stated, the UDF needs to update whenever i refresh the worksheet, wheter or not the input numbers change. The input parameter would be the data range (e.g. If the starting data was A:[1,2,5], B:[6,3,2], C:[4,5,6,7], D:[6], E:[3,7,8] the UDF's input would be A1:E4, so note that the input contains empty cells too) and the output would be an array containing a random solution (e.g. [1,3,7,6,8] or [3,2,4,6,7], with the previous data). The UDF needs to take an optimised path, otherwise it's going to be very slow with large datasets. This is probably the hardest part, which is why i asked for help in this forum. Here is a sample to better understand the problem: samples.xlsm
--to the moderators, I'm aware that i've already asked this on another thread but the answer i got is giving issues so I posted again to state the problem more clearly and hopefull receive new answers. Please don't take this down, thank you--
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Status
Not open for further replies.

Forum statistics

Threads
1,215,098
Messages
6,123,082
Members
449,094
Latest member
mystic19

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