Linear interpolation of 2-way array using spill functions

AEAA

New Member
Joined
Apr 12, 2022
Messages
30
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi all,

I am having some issues with the following problem.

I have a range of coordinates x [m] and 5 items defined by the functions x1,y1, x2,y2, x3,y3 and x4,y4.

My objective is to find the y [mm2] value corresponding to my x-value by finding the value inside of my x1-x4,y1-y4 list. I need to do this for each one of the 10 items and then sum all the values into one column:


Bar12345
x1 [m]-11.15-10.06-8.62-8.22-8.22
x2 [m]-11.15-9.13-8.62-7.53-7.53
x3 [m]-8.62-8.62-0.50-5.21-5.91
x4 [m]-8.62-8.62-0.50-4.52-5.22
y1 [mm2]00245400
y2 [mm2]157124542454785785
y3 [mm2]157124542454785785
y4 [mm2]00245400



Anch_Summary_1:
1649865709589.png


The way I am currently doing this is by this linear interpolation :

Where C$14:C$17 is x1 through x4 and C$18:C$21 is y1 through y4 for Item 1 and then I drag this equation to get D, E , F, G for items 2 through 4.

=IFERROR(INDEX(C$18:C$21;MATCH(Anch_Summary_1[@[x '[m']]:[x '[m']]];C$14:C$17;0));IFERROR(INDEX(C$18:C$21;MATCH(SMALL(C$14:C$17;COUNTIF(C$14:C$17;"<="&Anch_Summary_1[@[x '[m']]:[x '[m']]]));C$14:C$17;0))-(SMALL(C$14:C$17;COUNTIF(C$14:C$17;"<="&Anch_Summary_1[@[x '[m']]:[x '[m']]]))-Anch_Summary_1[@[x '[m']]:[x '[m']]])*(INDEX(C$18:C$21;MATCH(SMALL(C$14:C$17;COUNTIF(C$14:C$17;"<="&Anch_Summary_1[@[x '[m']]:[x '[m']]]));C$14:C$17;0))-INDEX(C$18:C$21;MATCH(LARGE(C$14:C$17;COUNTIF(C$14:C$17;">="&Anch_Summary_1[@[x '[m']]:[x '[m']]]));C$14:C$17;0)))/(SMALL(C$14:C$17;COUNTIF(C$14:C$17;"<="&Anch_Summary_1[@[x '[m']]:[x '[m']]]))-LARGE(C$14:C$17;COUNTIF(C$14:C$17;">="&Anch_Summary_1[@[x '[m']]:[x '[m']]])));0))

At the end of my operation I do SUM(1,2,3,4,5) and it is working as it intended. My issue is that Whenever I add an additional item 6 and so on, my sum range is not dynamic and the table does not automatically expand to have more x coordinates. I would have like to do all these operations through array/spill functions in which all the intermediate steps are potentially condensed into one formula and I can have only x [m] and Total [mm2] as dynamic spill arrays.

My main issue is that whenever I try to convert the previous equation into an array logic, most of my functions like SMALL, LARGE, COUNTIF and so on do not work on spill ranges and the whole logic must be changed.

If you have any ideas on how to tackle this issue I am open to suggestions, I am familiar with VBA and PowerQuery, but would prefer to avoid them.

Thank you very much for you help
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,214,395
Messages
6,119,265
Members
448,881
Latest member
Faxgirl

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