How to convert a list of XYZ coordinates to XY table

TinWhisker26p2

New Member
Joined
Sep 11, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have a list of x, Y, Z coordinates. The data represents real-world grid locations (1764 or 42 x 42 points) . The data is not in order and the values float around target grid points.

How could I convert the data table into an X-Y matrix of Z values?
I can do it with brute force, but this is not practical for my application.

Attached an image of a sample list and table
 

Attachments

  • List-to-Table.jpg
    List-to-Table.jpg
    102.8 KB · Views: 187

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi & welcome to MrExcel.
As long as you are happy to rearrange the data so that it's in one range, how about
+Fluff 1.xlsm
ABCDEFGHIJK
1xyz
21.015.015012345
30.981.015515558514851
41.0224324346555743
514.044035147495657
61.043.025144050475248
72.0134755050534657
81.970.9858
91.954.9750
102.04450
1122.0446
123.023.0449
1334.0247
143.045.0453
153.011.0251
162.971.9555
174.011.9757
183.98148
194.024.9546
2043.0156
214.043.9852
225.011.0451
234.972.9757
244.954.0148
255.042.0143
265557
Master
Cell Formulas
RangeFormula
F3:J7F3=LET(Ary,SORT(ROUND(A2:C26,0),{1,2}),Cols,MAX(INDEX(Ary,,1)),INDEX(INDEX(Ary,,3),SEQUENCE(ROWS(Ary)/Cols,,0)+SEQUENCE(,Cols,,Cols)))
Dynamic array formulas.
 
Upvote 0
Another option in case you can have missing data points.
+Fluff 1.xlsm
ABCDEFGHIJK
1xyz
21.015.015012345
30.981.015515558514851
41.0224324346555743
514.044035147495657
61.043.025144050475248
72.0134755050534657
81.970.9858
91.954.975012345
102.0445015558514851
1122.044624346555743
123.023.044935147495657
1334.024744050475248
143.045.045355050534657
153.011.0251
162.971.9555
174.011.9757
183.98148
194.024.9546
2043.0156
214.043.9852
225.011.0451
234.972.9757
244.954.0148
255.042.0143
265557
27
28
Master
Cell Formulas
RangeFormula
F3:J7F3=LET(Ary,SORT(ROUND(A2:C26,0),{1,2}),Cols,MAX(INDEX(Ary,,1)),INDEX(INDEX(Ary,,3),SEQUENCE(ROWS(Ary)/Cols,,0)+SEQUENCE(,Cols,,Cols)))
F9:J9F9=SEQUENCE(,MAX(ROUND(A2:A100,0)))
E10:E14E10=SEQUENCE(MAX(ROUND(B2:B100,0)))
F10:J14F10=LET(Ary,FILTER(ROUND(A2:C100,0),A2:A100<>""),IFNA(INDEX(INDEX(Ary,,3),MATCH(F9#&E10#,INDEX(Ary,,1)&INDEX(Ary,,2),0)),""))
Dynamic array formulas.
 
Upvote 0
Thanks. My first few attempts with solution #1 and my full 1764 data. I got a #spill! error. I got past this by driving to the distant ends of the sheet and entered dummy data. Then, I got #value! errors. I think I need to play with a smaller data set first to see where my error might be.
Thanks for giving me a good place to start. I think Choice #1 would work.
 
Upvote 0
If you are getting a #Spill error, it means that there are some non empty cells in the way of the formula.
 
Upvote 0
Hi Fluff, I could not get your suggestions to work.
I did find an easier work-around versus my original brute-force method. This takes several easy steps. My X and Y locations don't line up perfectly: 1.001, 0.998, 1.004....., but these are just addresses on my grid. The values hover around 42 discrete values. Why not force them into integers, and then sort...

I created three new columns: (#, X2 and Y2): # just lists integers 1 to 1764 (42x42 array). I sort my data by X (data), and fill X2 column 1, 1, 1...., 2, 2, 2, ..... 42, 42, 42). I re-sort (data & X2) by Y (data) and number (Y2) column in the same way: 11111..., 22222...., 33333........42. Then I do custom sort, first by X2, then by Y2 so my data reads (1, 1, Z); (1, 2, Z)..... I copy just my Z column and paste in a new column (say starting in Cell F1 down to Cell F1764). For Cell G1: G1 = F43 and copy down. H1 = G43.... Copy down and over until my columns are just copying zeros. Copy the array of cells from F1 to AV42, paste on new tab as values and BOOM!

It's not elegant, but it works.
 
Upvote 0

Forum statistics

Threads
1,214,960
Messages
6,122,479
Members
449,088
Latest member
Melvetica

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