Interpolating data points in Excel

后端 未结 7 933
猫巷女王i
猫巷女王i 2021-01-31 19:19

I\'m sure this is the kind of problem other have solved many times before.

A group of people are going to do measurements (Home energy usage to be exact). All of them wi

7条回答
  •  情书的邮戳
    2021-01-31 19:59

    I came across this and was reluctant to use an add-in because it makes it tough to share the sheet with people who don't have the add-in installed.

    My officemate designed a clean formula that is relatively compact (at the expensive of using a bit of magic).

    Things to note:

    • The formula works by:

      • using the MATCH function to find the row in the inputs range just before the value being searched for (e.g. 3 is the value just before 3.5)
      • using OFFSETs to select the square of that line and the next (in light purple)
      • using FORECAST to build a linear interpolation using just those two points, and getting the result
    • This formula cannot do extrapolations; make sure that your search value is between the endpoints (I do this in the example below by having extreme values).

    Not sure if this is too complicated for folks; but it had the benefit of being very portable (and simpler than many alternate solutions).

    If you want to copy-paste the formula, it is:

    =FORECAST(F3,OFFSET(inputs,MATCH(F3,inputs)-1,1,2,1),OFFSET(inputs,MATCH(F3,inputs)-1,0,2,1

    (inputs being a named range)

提交回复
热议问题