"vlookup" return interpolated values if no exact match?

Thanks, that I think confirms my thoughts on it. I have a plan… :wink:

This consists of two parts. The first part is a new component that extracts a table which is then used as the lookup table in the existing component.

e.g
Given your table:

x/y 2 4 6 8
10 35 40 45 50
20 40 45 50 55
30 45 50 55 60
40 50 55 60 65

presented with “x=15” the first component fetches the lookup table for x=15 based on the values “either side or equal to x”

x 2 4 6 8
10 35 40 45 50
20 40 45 50 55

This table is then recalculated into a single row using the interpolation formula for where 15 is located between 10 and 20, being applied to each of the returned “y” values.

Resulting in a table such as this:

x 2 4 6 8
15 37.5 42.5 47.5 52.5

This table can then be transposed to form a new lookup table:

N V
2 37.5
4 42.5
6 47.5
8 52.5

and is then the subject of a lookup of the Y value (3 in your example) using the existing component…

which would hopefully return the correct point between 37.5 and 42.5, which is 40 as confirmed by your spreadsheet.

Well, that’s the plan. That feels quite doable. Once this second “Interpolated TABLE lookup” component is built , it and the existing “Interpolated VALUE Lookup” component could be packaged inside a third “wrapper” component … hopefully I’ll have some time later to build it, but if anybody else wishes to take up the challenge in the meantime, feel free :wink:

EDIT: @b_mitchell , I have a prototype built. Currently I’m combining two components. Perhaps you could give your thoughts to the following test data. It looks right to me, but would be useful if you could check it too.

X Y Value
10.0 1.0 35.0
20.0 2.0 40.0
15.0 3.0 40.0
30.0 4.0 50.0
42.0 5.0 57.5
60.0 6.0 60.0
45.0 7.0 62.5
38.0 8.0 62.714
9.0 9.0 50.0
1.0 10.0 50.0

2 Likes