replacing array for a position number

Status
Not open for further replies.

montecarlo2012

Well-known Member
Joined
Jan 26, 2011
Messages
984
Office Version
  1. 2010
Platform
  1. Windows
Hello everyone.

I post this 3 days ago on ozgrid, and this is the post.(no answer).

The list at the left is the data (A1:F1900) in the middle the table (is like a parking lot - place number), and in the right is the swap results, I mean if I put the table in front of the list, and want to know what place number 2 was before, I can see was in the position 7 in the table, next #6 was in 8 and so on, see the example:
Code:
[TABLE="width: 653"]
<tbody>[TR]
[TD="class: xl63, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]2[/COLOR][/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]25[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]31[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]37[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]50[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]1[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]2[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]3[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]4[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]5[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl64, width: 33, bgcolor: transparent"][FONT=Calibri]7[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]8[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]28[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]52[/FONT]
[/TD]
[TD="class: xl64, width: 49, bgcolor: transparent"][FONT=Calibri]47[/FONT]
[/TD]
[TD="class: xl66, width: 49, bgcolor: transparent"][FONT=Calibri]etc.[/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl63, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]2[/COLOR][/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]11[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]18[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]38[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]48[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]7[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]8[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]9[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]10[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]11[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]12[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 33, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]2[/COLOR][/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]22[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]26[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]44[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]46[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]47[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]13[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]14[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]15[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]16[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]17[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]18[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 33, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]8[/COLOR][/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]14[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]22[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]26[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]33[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]51[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]19[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]20[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]21[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]22[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]23[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]24[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 33, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl63, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]5[/COLOR][/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]9[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]25[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]39[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]41[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]25[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]26[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]27[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]28[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]29[/FONT]
[/TD]
[TD="class: xl64, width: 41, bgcolor: transparent"][FONT=Calibri]30[/FONT]
[/TD]
[TD="class: xl67, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 33, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 49, bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
when I go to swap the second line I mean 2-6-11-18-etc. the table has to move one cell down like this.
Code:
[TABLE="width: 653"]
<tbody>[TR]
[TD="class: xl65, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]2[/COLOR][/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]25[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]31[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]37[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]50[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl66, width: 33, bgcolor: transparent"][FONT=Calibri]7[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]8[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]28[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]52[/FONT]
[/TD]
[TD="class: xl66, width: 49, bgcolor: transparent"][FONT=Calibri]47[/FONT]
[/TD]
[TD="class: xl68, width: 49, bgcolor: transparent"][FONT=Calibri]etc.[/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]2[/COLOR][/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]11[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]18[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]38[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]48[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]1[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]2[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]3[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]4[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]5[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl66, width: 33, bgcolor: transparent"][FONT=Calibri]7[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]20[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]49[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]55[/FONT]
[/TD]
[TD="class: xl68, width: 49, bgcolor: transparent"][FONT=Calibri]etc. [/FONT]
[/TD]
[TD="class: xl68, width: 49, bgcolor: transparent"][FONT=Calibri]etc.[/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]2[/COLOR][/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]22[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]26[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]44[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]46[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]47[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]7[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]8[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]9[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]10[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]11[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]12[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 33, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 49, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 49, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]8[/COLOR][/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]14[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]22[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]26[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]33[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]51[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]13[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]14[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]15[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]16[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]17[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]18[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 33, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 49, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 49, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 32, bgcolor: transparent"][FONT=Calibri][COLOR=#3e3e3e]5[/COLOR][/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]6[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]9[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]25[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]39[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]41[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]19[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]20[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]21[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]22[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]23[/FONT]
[/TD]
[TD="class: xl66, width: 41, bgcolor: transparent"][FONT=Calibri]24[/FONT]
[/TD]
[TD="class: xl70, width: 64, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 33, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 41, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 49, bgcolor: transparent"][/TD]
[TD="class: xl69, bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
and for the next number, the same thing, the tabe go down one place and according from the new position swap the numbers.
The position talbe is on H:M from 1 to 500, I don't write H1:M500 because remember this table go down one row every time, well at least I don't find another way to explain.
Thanks for reading this.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Status
Not open for further replies.

Forum statistics

Threads
1,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

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