Calculating Number of Changes between 2 Ranges

Tlazenby

New Member
Joined
Mar 20, 2016
Messages
3
Hello,

I am attempting to count the number of differences between ranges and then optimize the order in which these ranges should be ordered to minimize the changes.

Kit #1Kit #2Kit #3Kit #4Kit #5Kit #6OrderKit Changes
11115674
11227962
11266953
22356941
22567931
22677922
33677910

<tbody>
</tbody>


I have devised a way to complete this currently but am looking for a more simple method so I can combine this with other portions of my workbook. The formula I am currently using is as follows:

Code:
=IFERROR(IF(I2=1,0,IF((COUNTIF(INDIRECT(K2),C2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),C2))<=-1,0,(COUNTIF(INDIRECT(K2),C2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),C2)))+IF(D2=C2,0,IF((COUNTIF(INDIRECT(K2),D2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),D2))<=-1,0,(COUNTIF(INDIRECT(K2),D2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),D2))))+IF(OR(E2=D2,E2=C2),0,IF((COUNTIF(INDIRECT(K2),E2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),E2))<=-1,0,(COUNTIF(INDIRECT(K2),E2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),E2))))+IF(OR(F2=E2,F2=D2,F2=C2),0,IF((COUNTIF(INDIRECT(K2),F2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),F2))<=-1,0,(COUNTIF(INDIRECT(K2),F2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),F2))))+IF(OR(G2=F2,G2=E2,G2=D2,G2=C2),0,IF((COUNTIF(INDIRECT(K2),G2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),G2))<=-1,0,(COUNTIF(INDIRECT(K2),G2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),G2))))+IF(OR(H2=G2,H2=F2,H2=E2,H2=D2,H2=C2),0,IF((COUNTIF(INDIRECT(K2),H2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),H2))<=-1,0,(COUNTIF(INDIRECT(K2),H2)-COUNTIF(INDIRECT(INDEX($I$2:$K$25,MATCH(I2-1,$I$2:$I$25,0),3)),H2))))),"")

I certainly do not expect anyone to read through that formula just providing the method I currently am using.

I then use Excel solver to optimize the order, unfortunately my current method requires the use of the Evolutionary method of solving whereas I would prefer to be able to make this linear so I could add the changes as determent in a larger model.

Can email my workbook if it would be beneficial to anyone willing to help out.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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