Home > Back-end >  Transform y-axis coordinates to new min and max sequence in Google Sheets
Transform y-axis coordinates to new min and max sequence in Google Sheets

Time:06-24

I have manually extracted y-axis coordinates from a graph and placed it in google sheets. First value starts at A1 and the last value is at A57

31.452
44.52855
44.57402
44.59986
44.6226
44.63087
44.6381
44.62157
44.59779
44.54612
44.49237
44.4314
44.36732
44.30427
44.24019
44.18438
44.12961
44.09447
44.05622
43.98905
43.89499
43.76994
43.59837
43.38443
43.12708
42.82633
42.49973
42.14213
41.82587
41.55199
41.37939
41.37629
41.55509
41.91992
42.50567
43.31687
44.41017
45.77972
47.35682
49.01285
50.84865
52.76339
54.65035
56.62502
58.48567
60.40772
62.21283
64.00625
65.67835
67.29199
68.83255
70.26056
71.65934
73.02889
74.3239
75.60721
84.88795

31.452 is the y-axis coordinate for the top of the graph. It's true value is 1.

84.88795 is the y-axis coordinate for the bottom of the graph. It's true value is -3.

All the y-axis coordinates in-between 31.452 and 84.88795 are true values of which I don't have. I'm trying to find these true values. All I have are the y-axis coordinates for them. Since the true values range from -3 to 1. I don't know what the true value is for say the y-axis coordinate 44.09447. In order to find the true values for these y-axis coordinates in the graph, I need a way to linearly transform the entire sequence. So that 31.452 becomes the max value of 1 and 84.88795 becomes the min value of -3. And all the true values in between are correctly sequenced.

So the result is something like this (shortened version):

1 (max)
0.78382 (true value)
0.73616 (true value)
0.717135 (true value)
0.517315 (true value)
0.281357 (true value)
0.126162 (true value)
-0.831388 (true value)
-1.38312 (true value)
-1.9878 (true value)
-2.98469 (true value)
-3 (min)

I'm assuming this will require a linear transformation.

CodePudding user response:

=FORECAST.LINEAR(A1,{1,-3},{31.452,84.88795})

Reference:

FORECAST

  • Related