IDidNotDoIt
New Member
Hi, all!
I have a workbook that solves the problem of finding the optimal way to go thru a group of addresses identified by their geographic coordinates, in order to minimize the distance.
Technically speaking, It is developed using VBA and array formulas, as it was originally intended to be used on a single computer at the back office of the main warehouse. Later it shifted to several computers at each warehouse branch, and after that to notebooks and tablets distributed on the delivery vehicles. In both cases there were no major changes to be made to adapt to those new scenarios.
Now a new shift is being analized where data processing should be done at cell phones too. So considering the constraints imposed by the Android version of Excel, there is a lot of work to do. Work mainly related to VBA code replacement and eliminating array formulas, which is yet done exception made of the following problem:
Let's say that we have distances to 5 points at B2:F2 (where 99 means same source and target point or point yet used), 5 indicators of points already used at A3:A7 (where 0 means point not reached and 1 point yet reached), and the goal is to obtain the number of the point not used with the minimum distance to it.
The goal is to obtain a value of 2 (2nd position) at B8, that represents the point at C2 (or E2 in distinctly, but I prefer C2) that has a distance of 2 units which is the shortest distance to not used points, i.e., the point with a distance of 1 unit at B2 is yet used as per the value of 1 at A3.
At C8 there is a first approach using SUMPRODUCT which works as expected, but at D8 there is an intent of fine tuning OF previous SUMPRODUCT which does not work, due to the constraints of mobile Excel version. I tried to use MMULT too but with unsatisfactory results.
The idea is to obtain kinda this:
a) start with B2:F2 values
{1,2,11,99,2}
b) update according with A3:A7 values
{1,0,0,1,0}
{99,2,11,99,2}
x) get the order of min value
2, at 2nd or 5th position.
Playing maths:
=MATCH(MIN(SUMPRODUCT((B2:F2)<>99*,(TRANSPOSE(A3:A7))<>1);SUMPRODUCT((B2:F2)<>99*,(TRANSPOSE(A3:A7))<>1))
Something alike with these conditions:
- no helper cells allowed
- no array formulas allowed
-... that's to say, just a non-array formula
Attached file with sample values.
Thank you so much for your time and help.
Best regards.
I have a workbook that solves the problem of finding the optimal way to go thru a group of addresses identified by their geographic coordinates, in order to minimize the distance.
Technically speaking, It is developed using VBA and array formulas, as it was originally intended to be used on a single computer at the back office of the main warehouse. Later it shifted to several computers at each warehouse branch, and after that to notebooks and tablets distributed on the delivery vehicles. In both cases there were no major changes to be made to adapt to those new scenarios.
Now a new shift is being analized where data processing should be done at cell phones too. So considering the constraints imposed by the Android version of Excel, there is a lot of work to do. Work mainly related to VBA code replacement and eliminating array formulas, which is yet done exception made of the following problem:
Let's say that we have distances to 5 points at B2:F2 (where 99 means same source and target point or point yet used), 5 indicators of points already used at A3:A7 (where 0 means point not reached and 1 point yet reached), and the goal is to obtain the number of the point not used with the minimum distance to it.
The goal is to obtain a value of 2 (2nd position) at B8, that represents the point at C2 (or E2 in distinctly, but I prefer C2) that has a distance of 2 units which is the shortest distance to not used points, i.e., the point with a distance of 1 unit at B2 is yet used as per the value of 1 at A3.
At C8 there is a first approach using SUMPRODUCT which works as expected, but at D8 there is an intent of fine tuning OF previous SUMPRODUCT which does not work, due to the constraints of mobile Excel version. I tried to use MMULT too but with unsatisfactory results.
The idea is to obtain kinda this:
a) start with B2:F2 values
{1,2,11,99,2}
b) update according with A3:A7 values
{1,0,0,1,0}
{99,2,11,99,2}
x) get the order of min value
2, at 2nd or 5th position.
Playing maths:
=MATCH(MIN(SUMPRODUCT((B2:F2)<>99*,(TRANSPOSE(A3:A7))<>1);SUMPRODUCT((B2:F2)<>99*,(TRANSPOSE(A3:A7))<>1))
Something alike with these conditions:
- no helper cells allowed
- no array formulas allowed
-... that's to say, just a non-array formula
Attached file with sample values.
Thank you so much for your time and help.
Best regards.