Here's one...

M

Matt

I'm assuming this one may require a macro. I have a matrix in excel
where each row represents a specific ID # and the column headings give
details about each ID #.

I want to pull out a set of x ID #s (can the number to pull out be
user defined?) from this example list according to set criteria:

ID # Area Detail Zone Route Quantity
10-A 3rd Flr alpha 2 C 0
10-B 2nd Flr bravo 2 B 1
10-C 2nd Flr charlie 3 A 0
10-D 2nd Flr delta 2 A 2
10-E Bsmt echo 3 C 0
10-F 1st Flr foxtrot 2 C 3
10-G 2nd Flr golf 3 B 0
10-H 3rd Flr hotel 3 C 1
10-I 2nd Flr india 3 B 1
10-J 3rdFlr juliet 3 C 0
10-K Bsmt kilo 3 C 0

The criteria are:
-that the Zone of the selected ID must be 2 (or 3, depending on user-
input)
-that the Route should be the same for the three IDs, but which route
is chosen randomly.
-If, given the two previous criteria, there are now fewer IDs left
than being asked for, expand the pool to two randomly chosen routes
that the IDs can be chosen from.
-If, given the two previous criteria, there are now more IDs left
than being asked for, take the smallest X of the IDs left in the pool

So, if a user wants 4 Zone 3s, and the computer randomly chose Route
C, then it would give:

10-A
10-E
10-J
10-K

Or, if a user wants 4 Zone 3s, and the computer randomly chose Route
A, then it would have to add another randomly chosen route, say B. So
now, out of Route A and B, it would give:

10-B
10-C
10-G
10-I

Hopefully this makes sense enough. Let me know if not. I appreciate
any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top