bbrimberry
New Member
- Joined
- Mar 23, 2016
- Messages
- 34
Hello,
I am hopeful someone will be able to help me with the problem outlined below.
I have 2 tables. One table has sales reps and the number of hours in a week they work.
[TABLE="width: 431"]
<tbody>[TR]
[TD]Rep[/TD]
[TD]Weekly Hours[/TD]
[TD]Capacity How many hours left?[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
My second table has stores each rep can drive to.
[TABLE="width: 267"]
<tbody>[TR]
[TD]Rep[/TD]
[TD]Store Number[/TD]
[TD]Miles Away[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]85[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]91[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]31[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]21[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]98[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]28[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]90[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]49[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]63[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]95[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]47[/TD]
[TD="align: right"]76[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]48[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]26[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]64[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]71[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]32[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]79[/TD]
[/TR]
</tbody>[/TABLE]
I need to get excel to return the stores that are within each reps capacity of 40 hours.
I would like excel to somehow return the stores with the least number of miles.
if we used rep john as an example john has 2 hours left.
lets also assume that each store is 1 hour of work.
so i would like exel to return the 2 rows below as the answer
[TABLE="width: 267"]
<tbody>[TR]
[TD]Rep[/TD]
[TD]Store Number[/TD]
[TD]Miles Away[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]28[/TD]
[/TR]
</tbody>[/TABLE]
thanks for any help provided.
I am hopeful someone will be able to help me with the problem outlined below.
I have 2 tables. One table has sales reps and the number of hours in a week they work.
[TABLE="width: 431"]
<tbody>[TR]
[TD]Rep[/TD]
[TD]Weekly Hours[/TD]
[TD]Capacity How many hours left?[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
My second table has stores each rep can drive to.
[TABLE="width: 267"]
<tbody>[TR]
[TD]Rep[/TD]
[TD]Store Number[/TD]
[TD]Miles Away[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]85[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]91[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]31[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]21[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]98[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]28[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]90[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]49[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]30[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]63[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]95[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]47[/TD]
[TD="align: right"]76[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]48[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]56[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]26[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]64[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]71[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]32[/TD]
[/TR]
[TR]
[TD]Sue[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]79[/TD]
[/TR]
</tbody>[/TABLE]
I need to get excel to return the stores that are within each reps capacity of 40 hours.
I would like excel to somehow return the stores with the least number of miles.
if we used rep john as an example john has 2 hours left.
lets also assume that each store is 1 hour of work.
so i would like exel to return the 2 rows below as the answer
[TABLE="width: 267"]
<tbody>[TR]
[TD]Rep[/TD]
[TD]Store Number[/TD]
[TD]Miles Away[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]28[/TD]
[/TR]
</tbody>[/TABLE]
thanks for any help provided.