I have a list of cities in column A with a set of values assigned to them in column B. Is there a formula I can use to determine which cities values would go together with the sum being between two numbers and without including more than three cities. For example if the range that the sum must be between is 15,000 to 16,000, I need to know all the possible scenarios of pairing the cities up where the sum of the values assigned to them will equal this range. Also keep in mind this could be the sum of up to 3 of the numbers. Then I have a list of the same cities in a table showing the distance between each city. Is there a way to take the scenarios given from above and analyze them so it will identify the shortest distance to travel? I've pasted a section of this table below. What I'm trying to do is to create a file that will help me to plan deliveries. The table below will show all of the cities that we deliver to. The list of cities will have the weight of material I have to deliver in each city. I'd like to determine which cities could be paired together without going over three stops where the weight would be within the range listed above, and then determine the best route. For example City A may be able to be matched with either city B or city C, but the distance between city A and B is less than between city A and C. Therefore I would want to match A and B together. [TABLE="width: 809"]
<colgroup><col width="142" style="width: 106pt; mso-width-source: userset; mso-width-alt: 5034;"> <col width="114" style="width: 85pt; mso-width-source: userset; mso-width-alt: 4039;"> <col width="102" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3640;"> <col width="99" style="width: 74pt; mso-width-source: userset; mso-width-alt: 3527;"> <col width="93" style="width: 70pt; mso-width-source: userset; mso-width-alt: 3299;"> <col width="136" style="width: 102pt; mso-width-source: userset; mso-width-alt: 4835;"> <col width="129" style="width: 97pt; mso-width-source: userset; mso-width-alt: 4579;"> <col width="131" style="width: 98pt; mso-width-source: userset; mso-width-alt: 4664;"> <col width="133" style="width: 100pt; mso-width-source: userset; mso-width-alt: 4721;"> <tbody>[TR]
[TD="class: xl66, width: 142, bgcolor: #DDEBF7"]Row Labels[/TD]
[TD="class: xl67, width: 114, bgcolor: #DDEBF7"]AGRICOLA, MS[/TD]
[TD="class: xl67, width: 102, bgcolor: #DDEBF7"]ARABI, LA[/TD]
[TD="class: xl67, width: 99, bgcolor: #DDEBF7"]ATMORE, AL[/TD]
[TD="class: xl67, width: 93, bgcolor: #DDEBF7"]BAKER, FL[/TD]
[TD="class: xl67, width: 136, bgcolor: #DDEBF7"]BATON ROUGE, LA[/TD]
[TD="class: xl67, width: 129, bgcolor: #DDEBF7"]BAY MINETTE, AL[/TD]
[TD="class: xl67, width: 131, bgcolor: #DDEBF7"]BAY SPRINGS, MS[/TD]
[TD="class: xl67, width: 133, bgcolor: #DDEBF7"]BAY ST LOUIS, MS[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]AGRICOLA, MS[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[TD="class: xl68, bgcolor: transparent"]76[/TD]
[TD="class: xl68, bgcolor: transparent"]129[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]60[/TD]
[TD="class: xl68, bgcolor: transparent"]107[/TD]
[TD="class: xl68, bgcolor: transparent"]84[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]ARABI, LA[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]236[/TD]
[TD="class: xl68, bgcolor: transparent"]85[/TD]
[TD="class: xl68, bgcolor: transparent"]176[/TD]
[TD="class: xl68, bgcolor: transparent"]163[/TD]
[TD="class: xl68, bgcolor: transparent"]58[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]ATMORE, AL[/TD]
[TD="class: xl68, bgcolor: transparent"]76[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]55[/TD]
[TD="class: xl68, bgcolor: transparent"]248[/TD]
[TD="class: xl68, bgcolor: transparent"]20[/TD]
[TD="class: xl68, bgcolor: transparent"]169[/TD]
[TD="class: xl68, bgcolor: transparent"]140[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAKER, FL[/TD]
[TD="class: xl68, bgcolor: transparent"]131[/TD]
[TD="class: xl68, bgcolor: transparent"]236[/TD]
[TD="class: xl68, bgcolor: transparent"]55[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]292[/TD]
[TD="class: xl68, bgcolor: transparent"]75[/TD]
[TD="class: xl68, bgcolor: transparent"]216[/TD]
[TD="class: xl68, bgcolor: transparent"]184[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BATON ROUGE, LA[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]84[/TD]
[TD="class: xl68, bgcolor: transparent"]248[/TD]
[TD="class: xl68, bgcolor: transparent"]292[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]232[/TD]
[TD="class: xl68, bgcolor: transparent"]207[/TD]
[TD="class: xl68, bgcolor: transparent"]114[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAY MINETTE, AL[/TD]
[TD="class: xl68, bgcolor: transparent"]60[/TD]
[TD="class: xl68, bgcolor: transparent"]176[/TD]
[TD="class: xl68, bgcolor: transparent"]20[/TD]
[TD="class: xl68, bgcolor: transparent"]75[/TD]
[TD="class: xl68, bgcolor: transparent"]232[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]152[/TD]
[TD="class: xl68, bgcolor: transparent"]124[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAY SPRINGS, MS[/TD]
[TD="class: xl68, bgcolor: transparent"]107[/TD]
[TD="class: xl68, bgcolor: transparent"]163[/TD]
[TD="class: xl68, bgcolor: transparent"]168[/TD]
[TD="class: xl68, bgcolor: transparent"]216[/TD]
[TD="class: xl68, bgcolor: transparent"]206[/TD]
[TD="class: xl68, bgcolor: transparent"]152[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAY ST LOUIS, MS[/TD]
[TD="class: xl68, bgcolor: transparent"]84[/TD]
[TD="class: xl68, bgcolor: transparent"]59[/TD]
[TD="class: xl68, bgcolor: transparent"]140[/TD]
[TD="class: xl68, bgcolor: transparent"]184[/TD]
[TD="class: xl68, bgcolor: transparent"]114[/TD]
[TD="class: xl68, bgcolor: transparent"]124[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[/TR]
</tbody>[/TABLE]
<colgroup><col width="142" style="width: 106pt; mso-width-source: userset; mso-width-alt: 5034;"> <col width="114" style="width: 85pt; mso-width-source: userset; mso-width-alt: 4039;"> <col width="102" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3640;"> <col width="99" style="width: 74pt; mso-width-source: userset; mso-width-alt: 3527;"> <col width="93" style="width: 70pt; mso-width-source: userset; mso-width-alt: 3299;"> <col width="136" style="width: 102pt; mso-width-source: userset; mso-width-alt: 4835;"> <col width="129" style="width: 97pt; mso-width-source: userset; mso-width-alt: 4579;"> <col width="131" style="width: 98pt; mso-width-source: userset; mso-width-alt: 4664;"> <col width="133" style="width: 100pt; mso-width-source: userset; mso-width-alt: 4721;"> <tbody>[TR]
[TD="class: xl66, width: 142, bgcolor: #DDEBF7"]Row Labels[/TD]
[TD="class: xl67, width: 114, bgcolor: #DDEBF7"]AGRICOLA, MS[/TD]
[TD="class: xl67, width: 102, bgcolor: #DDEBF7"]ARABI, LA[/TD]
[TD="class: xl67, width: 99, bgcolor: #DDEBF7"]ATMORE, AL[/TD]
[TD="class: xl67, width: 93, bgcolor: #DDEBF7"]BAKER, FL[/TD]
[TD="class: xl67, width: 136, bgcolor: #DDEBF7"]BATON ROUGE, LA[/TD]
[TD="class: xl67, width: 129, bgcolor: #DDEBF7"]BAY MINETTE, AL[/TD]
[TD="class: xl67, width: 131, bgcolor: #DDEBF7"]BAY SPRINGS, MS[/TD]
[TD="class: xl67, width: 133, bgcolor: #DDEBF7"]BAY ST LOUIS, MS[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]AGRICOLA, MS[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[TD="class: xl68, bgcolor: transparent"]76[/TD]
[TD="class: xl68, bgcolor: transparent"]129[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]60[/TD]
[TD="class: xl68, bgcolor: transparent"]107[/TD]
[TD="class: xl68, bgcolor: transparent"]84[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]ARABI, LA[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]236[/TD]
[TD="class: xl68, bgcolor: transparent"]85[/TD]
[TD="class: xl68, bgcolor: transparent"]176[/TD]
[TD="class: xl68, bgcolor: transparent"]163[/TD]
[TD="class: xl68, bgcolor: transparent"]58[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]ATMORE, AL[/TD]
[TD="class: xl68, bgcolor: transparent"]76[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]55[/TD]
[TD="class: xl68, bgcolor: transparent"]248[/TD]
[TD="class: xl68, bgcolor: transparent"]20[/TD]
[TD="class: xl68, bgcolor: transparent"]169[/TD]
[TD="class: xl68, bgcolor: transparent"]140[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAKER, FL[/TD]
[TD="class: xl68, bgcolor: transparent"]131[/TD]
[TD="class: xl68, bgcolor: transparent"]236[/TD]
[TD="class: xl68, bgcolor: transparent"]55[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]292[/TD]
[TD="class: xl68, bgcolor: transparent"]75[/TD]
[TD="class: xl68, bgcolor: transparent"]216[/TD]
[TD="class: xl68, bgcolor: transparent"]184[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BATON ROUGE, LA[/TD]
[TD="class: xl68, bgcolor: transparent"]192[/TD]
[TD="class: xl68, bgcolor: transparent"]84[/TD]
[TD="class: xl68, bgcolor: transparent"]248[/TD]
[TD="class: xl68, bgcolor: transparent"]292[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]232[/TD]
[TD="class: xl68, bgcolor: transparent"]207[/TD]
[TD="class: xl68, bgcolor: transparent"]114[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAY MINETTE, AL[/TD]
[TD="class: xl68, bgcolor: transparent"]60[/TD]
[TD="class: xl68, bgcolor: transparent"]176[/TD]
[TD="class: xl68, bgcolor: transparent"]20[/TD]
[TD="class: xl68, bgcolor: transparent"]75[/TD]
[TD="class: xl68, bgcolor: transparent"]232[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]152[/TD]
[TD="class: xl68, bgcolor: transparent"]124[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAY SPRINGS, MS[/TD]
[TD="class: xl68, bgcolor: transparent"]107[/TD]
[TD="class: xl68, bgcolor: transparent"]163[/TD]
[TD="class: xl68, bgcolor: transparent"]168[/TD]
[TD="class: xl68, bgcolor: transparent"]216[/TD]
[TD="class: xl68, bgcolor: transparent"]206[/TD]
[TD="class: xl68, bgcolor: transparent"]152[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: #DDEBF7"]BAY ST LOUIS, MS[/TD]
[TD="class: xl68, bgcolor: transparent"]84[/TD]
[TD="class: xl68, bgcolor: transparent"]59[/TD]
[TD="class: xl68, bgcolor: transparent"]140[/TD]
[TD="class: xl68, bgcolor: transparent"]184[/TD]
[TD="class: xl68, bgcolor: transparent"]114[/TD]
[TD="class: xl68, bgcolor: transparent"]124[/TD]
[TD="class: xl68, bgcolor: transparent"]136[/TD]
[TD="class: xl68, bgcolor: transparent"]0[/TD]
[/TR]
</tbody>[/TABLE]