Replacing data...of differing character widths

ptm555

New Member
Joined
Jun 17, 2008
Messages
24
Hi all

I am hoping you can help me with this query. I am looking to automatically change the values in a matrix of proportions (shown as a proportion of 1000 vehicles). Unfortunately though the matrix below hasn't copied over very well from textpad and the columns are not in line!!

Shown below, '8002' is the three-arm node (junction) number in a traffic model and 305, 304 and 303 are the inbound links into the node. To illustrate, in the second row, 8 out of 1000 vehicles u-turn, 38 go to 304 and the rest (954) go to 303.

8002 P 305 304 303
305 8 38 954
304 148 0 852
303 794 206 0

I have extracted the above from a text file and I need to replace the proportions above exactly with new values, making sure the numbers are all still in line.

For example, if I changed the first line to having 12 u-turners, 150 to go to '304' and 838 to go to '303' I would not want the columns to then go out of line due to the extra 2 characters in the '305' column and extra 1 character in the '304' column, i.e.:

8002 P 305 304 303
305 12 150 838
304 148 0 852
303 794 206 0

Any help appreciated. I get the feeling the solution may involved the 'LEFT, MID and RIGHT' functions... or maybe not

Yours appreciatively,
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,224,564
Messages
6,179,547
Members
452,925
Latest member
duyvmex

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