Interesting - Reorder road segments in a corridor

user90

New Member
Joined
Jan 3, 2015
Messages
1
Please help me in writing the formula. Because of match first occurence it is getting repeated.

I have "From", "To" NODE IDs of road segments which are not in order and needs to be reordered. I found the two unique values which are first node and last node of the corridor and started with one.

D2=E2
E3 =IF(INDEX($B$3:$C$33,IFERROR(MATCH($D3,$B$3:$B$33,0),MATCH($D3,$C$3:$C$33,0)),1)=D3,INDEX($B$3:$C$33,IFERROR(MATCH($D3,$B$3:$B$33,0),MATCH($D3,$C$3:C33,0)),2),INDEX($B$3:$C$33,IFERROR(MATCH($D3,$B$3:$B$33,0),MATCH($D3,$C$3:$C$33,0)),1))

[TABLE="width: 428"]
<tbody>[TR]
[TD]SlNo[/TD]
[TD]From[/TD]
[TD]To[/TD]
[TD]Reorder From[/TD]
[TD]Reorder To[/TD]
[TD]Row Occurrence[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]100028[/TD]
[TD="align: right"]329136[/TD]
[TD="align: right"]100028[/TD]
[TD="align: right"]329136[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]100192[/TD]
[TD="align: right"]329149[/TD]
[TD="align: right"]329136[/TD]
[TD="align: right"]100196[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]100192[/TD]
[TD="align: right"]329182[/TD]
[TD="align: right"]100196[/TD]
[TD="align: right"]329027[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]100193[/TD]
[TD="align: right"]100558[/TD]
[TD="align: right"]329027[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]27[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]100193[/TD]
[TD="align: right"]329147[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]100194[/TD]
[TD="align: right"]100425[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD="align: right"]100194[/TD]
[TD="align: right"]329189[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]100195[/TD]
[TD="align: right"]329059[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]100195[/TD]
[TD="align: right"]329139[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]100196[/TD]
[TD="align: right"]329027[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD="align: right"]100196[/TD]
[TD="align: right"]329136[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]100425[/TD]
[TD="align: right"]329144[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD="align: right"]100558[/TD]
[TD="align: right"]100646[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]100618[/TD]
[TD="align: right"]100619[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]100618[/TD]
[TD="align: right"]100656[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD="align: right"]100619[/TD]
[TD="align: right"]100620[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]17[/TD]
[TD="align: right"]100620[/TD]
[TD="align: right"]100621[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]18[/TD]
[TD="align: right"]100621[/TD]
[TD="align: right"]325013[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]19[/TD]
[TD="align: right"]100646[/TD]
[TD="align: right"]329189[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]100654[/TD]
[TD="align: right"]325012[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]21[/TD]
[TD="align: right"]100654[/TD]
[TD="align: right"]329185[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]22[/TD]
[TD="align: right"]100655[/TD]
[TD="align: right"]100656[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]23[/TD]
[TD="align: right"]100655[/TD]
[TD="align: right"]329186[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]24[/TD]
[TD="align: right"]320001[/TD]
[TD="align: right"]325013[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]325012[/TD]
[TD="align: right"]329186[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]26[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]27[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329139[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]28[/TD]
[TD="align: right"]329027[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]29[/TD]
[TD="align: right"]329059[/TD]
[TD="align: right"]329143[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]30[/TD]
[TD="align: right"]329143[/TD]
[TD="align: right"]329144[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]31[/TD]
[TD="align: right"]329147[/TD]
[TD="align: right"]329149[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]32[/TD]
[TD="align: right"]329182[/TD]
[TD="align: right"]329185[/TD]
[TD="align: right"]328011[/TD]
[TD="align: right"]329137[/TD]
[TD="align: right"]25[/TD]
[/TR]
</tbody>[/TABLE]

Thank you very much in advance.
 
Last edited:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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