Even Distribution List formula/ macro

jacinthn

Board Regular
Joined
Jun 15, 2010
Messages
96
i'm having trouble combining a INDEX MATCH with multiple criteria with a distribution formula i use
i have 15 unique representatives and 3 work multiple state grouping so 17 total
[TABLE="width: 400"]
<TBODY>[TR]
[TD]Availble Reps</SPAN>[/TD]
[TD]States worked by each rep</SPAN>[/TD]
[TD]J/NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]David A</SPAN>[/TD]
[TD]AZ CA CO ID MT NV OR UT WA WY </SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]Charles B</SPAN>[/TD]
[TD]AZ CA CO ID MT NV OR UT WA WY </SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]Ryan V</SPAN>[/TD]
[TD]AZ CA CO ID MT NV OR UT WA WY </SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]John G</SPAN>[/TD]
[TD]AZ CA CO ID MT NV OR UT WA WY </SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]Brian G</SPAN>[/TD]
[TD]AK HI MI MN MO NH OK RI TN</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]Harman O</SPAN>[/TD]
[TD]AK HI MI MN MO NH OK RI TN</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]Victoria J</SPAN>[/TD]
[TD]AK HI MI MN MO NH OK RI TN</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]Nigel O</SPAN>[/TD]
[TD]AK HI MI MN MO NH OK RI TN</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]Sue C</SPAN>[/TD]
[TD]TX-NJ AL AR DC GA MS NC VA WV</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]Clair R</SPAN>[/TD]
[TD]TX-NJ AL AR DC GA MS NC VA WV</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]Becky P</SPAN>[/TD]
[TD]TX-NJ AL AR DC GA MS NC VA WV</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]Sierra D</SPAN>[/TD]
[TD]IA IL IN KS KY ND NE NM OH PR SD TX-J WI</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]Christopher A</SPAN>[/TD]
[TD]CT DE FL LA MA MD ME NJ NY PA SC VT</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]Jack U</SPAN>[/TD]
[TD]CT DE FL LA MA MD ME NJ NY PA SC VT</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]John P</SPAN>[/TD]
[TD]AK HI MI MN MO NH OK RI TN</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
[TR]
[TD]David A</SPAN>[/TD]
[TD]AZ CA CO ID MT NV OR UT WA WY </SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[/TR]
[TR]
[TD]Sue C</SPAN>[/TD]
[TD]TX-NJ AL AR DC GA MS NC VA WV</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL></COLGROUP>[/TABLE]


i have to assign out 493 files to 17 names based on the above state groupings they work and if the file is a J or NJ the distribution formula i use is =INDEX($G$5:$G$21,INT(ROWS($E$1:E29)/$H$2)) (H2 is the number of files each rep will recieve in this case 29)

work great evenly distributes 29 to each name just does not first person in each state grouping when there are at least 3 reps working each state grouping.
so it will only assign all 493 to 5 names and i need it assgned to all 17 names

=INDEX($G$5:$G$21,MATCH("*"&C2&"*"&D2,$H$5:$H$21&$I$5:$I$21,0),1)

is there any way to combine these or does anyone know a better way to do the distribution based on the 2 critera where it will assign to all 17 names on the available rep list ?

this is what my sheet looks like any help at all would be GREATLY APPRECIATED
[TABLE="width: 984"]
<TBODY>[TR]
[TD]Audit #</SPAN>[/TD]
[TD]Assigned Rep (Assignmment FORMULA)</SPAN>[/TD]
[TD]Org State</SPAN>[/TD]
[TD]J/NJ</SPAN>[/TD]
[TD]index with criteria</SPAN>[/TD]
[TD]index with criteria + Assignment Formula (PROBLEM)</SPAN>[/TD]
[/TR]
[TR]
[TD]24185502</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]TN</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[TD]Brian G</SPAN>[/TD]
[TD]INDEX($G$5:$G$21,MATCH("*"&C2&"*"&D2,$H$5:$H$21&$I$5:$I$21,0),INT(ROWS($E$1:E29)/$H$2))</SPAN>[/TD]
[/TR]
[TR]
[TD]23877157</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]MN</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[TD]Brian G</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]30828684</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]TN</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]#N/A</SPAN>[/TD]
[TD]#N/A</SPAN>[/TD]
[/TR]
[TR]
[TD]20214950</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]NC</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]Sue C</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]25818650</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]AZ</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]31238014</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]MI</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[TD]Brian G</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]15719390</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]TX</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]Sue C</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]34509249</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]MO</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[TD]Brian G</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]19965564</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]RI</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]Brian G</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]11308717</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]NH</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]Brian G</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]31083270</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]WA</SPAN>[/TD]
[TD]J</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]21448204</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]UT</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]40933141</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]AL</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]Sue C</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
[TR]
[TD]15448262</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[TD]MS</SPAN>[/TD]
[TD]NJ</SPAN>[/TD]
[TD]Sue C</SPAN>[/TD]
[TD]David A</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL><COL><COL><COL></COLGROUP>[/TABLE]
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,098
Messages
6,170,100
Members
452,301
Latest member
QualityAssurance

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