Distance between points - matrix

DrunkDuck

New Member
Joined
Aug 6, 2019
Messages
1
Hey,

i'm trying to make a table that looks like this:

BCDEFG
1705101520
1800339.57.1
195300119.4
2010300119.4
21159.5111105.7
22207.19.49.45.70

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Data

Worksheet Formulas
CellFormula
C18=SQRT(SUMSQ($C$12-C12,$C$13-C13,$C$14-C14,$C$15-C15))
D18=SQRT(SUMSQ($C$12-D12,$C$13-D13,$C$14-D14,$C$15-D15))
E18=SQRT(SUMSQ($C$12-E12,$C$13-E13,$C$14-E14,$C$15-E15))
F18=SQRT(SUMSQ($C$12-F12,$C$13-F13,$C$14-F14,$C$15-F15))
G18=SQRT(SUMSQ($C$12-G12,$C$13-G13,$C$14-G14,$C$15-G15))
C19=SQRT(SUMSQ($D$12-C12,$D$13-C13,$D$14-C14,$D$15-C15))
D19=SQRT(SUMSQ($D$12-D12,$D$13-D13,$D$14-D14,$D$15-D15))
E19=SQRT(SUMSQ($D$12-E12,$D$13-E13,$D$14-E14,$D$15-E15))
F19=SQRT(SUMSQ($D$12-F12,$D$13-F13,$D$14-F14,$D$15-F15))
G19=SQRT(SUMSQ($D$12-G12,$D$13-G13,$D$14-G14,$D$15-G15))
C20=SQRT(SUMSQ($E$12-C12,$E$13-C13,$E$14-C14,$E$15-C15))
D20=SQRT(SUMSQ($E$12-D12,$E$13-D13,$E$14-D14,$E$15-D15))
E20=SQRT(SUMSQ($E$12-E12,$E$13-E13,$E$14-E14,$E$15-E15))
F20=SQRT(SUMSQ($E$12-F12,$E$13-F13,$E$14-F14,$E$15-F15))
G20=SQRT(SUMSQ($E$12-G12,$E$13-G13,$E$14-G14,$E$15-G15))
C21=SQRT(SUMSQ($F$12-C12,$F$13-C13,$F$14-C14,$F$15-C15))
D21=SQRT(SUMSQ($F$12-D12,$F$13-D13,$F$14-D14,$F$15-D15))
E21=SQRT(SUMSQ($F$12-E12,$F$13-E13,$F$14-E14,$F$15-E15))
F21=SQRT(SUMSQ($F$12-F12,$F$13-F13,$F$14-F14,$F$15-F15))
G21=SQRT(SUMSQ($F$12-G12,$F$13-G13,$F$14-G14,$F$15-G15))
C22=SQRT(SUMSQ($G$12-C12,$G$13-C13,$G$14-C14,$G$15-C15))
D22=SQRT(SUMSQ($G$12-D12,$G$13-D13,$G$14-D14,$G$15-D15))
E22=SQRT(SUMSQ($G$12-E12,$G$13-E13,$G$14-E14,$G$15-E15))
F22=SQRT(SUMSQ($G$12-F12,$G$13-F13,$G$14-F14,$G$15-F15))
G22=SQRT(SUMSQ($G$12-G12,$G$13-G13,$G$14-G14,$G$15-G15))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



from this kind of data:

BCDEFG
10tacts05101520
11criterium
12a111111
13a211124
14a341179
15a4111105

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Data



It's easy to set the formula in the left row with "$" to easily autofill to the right. Currently in the formula I have for example cell $C$12 that when going one cell down need to convert to $D$12.. I would be grateful for suggestions on possible changes to formula or a macro to be able to do this. I tried using macro with "Application.ConvertFormula" but i was able only to change every "$" in the cell but in this case it would need to be only specific ones.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Welcome to Mr Excel forum

Maybe something like this...


B
C
D
E
F
G
10
tacts​
0​
5​
10​
15​
20​
11
criterium​
12
a1​
1​
1​
1​
1​
1​
13
a2​
1​
1​
1​
2​
4​
14
a3​
4​
1​
1​
7​
9​
15
a4​
1​
1​
1​
10​
5​
16
17
0​
5​
10​
15​
20​
18
0​
0,0​
3,0​
3,0​
9,5​
7,1​
19
5​
3,0​
0,0​
0,0​
10,9​
9,4​
20
10​
3,0​
0,0​
0,0​
10,9​
9,4​
21
15​
9,5​
10,9​
10,9​
0,0​
5,7​
22
20​
7,1​
9,4​
9,4​
5,7​
0,0​

Formula in C18 copied across and down
=SQRT(SUMSQ(INDEX(INDEX($C$12:$G$15,0,MATCH($B18,$C$10:$G$10,0))-INDEX($C$12:$G$15,0,MATCH(C$17,$C$10:$G$10,0)),)))

Format as Number wit 1 decimal place.

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

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