+ Reply to Thread
Results 1 to 5 of 5

Interpolation formula

  1. #1
    Registered User
    Join Date
    04-27-2005
    MS-Off Ver
    2003
    Posts
    16

    Interpolation formula

    Hello experts, I have 2 columns (A1:A16 and B1:B16) with the following values:

    0 191
    2 213
    4 236
    6 260
    8 286
    10 313
    12 341
    14 371
    16 402
    18 434
    20 469
    22 505
    24 543
    26 582
    28 623
    30 666

    In cell D1 I can put any value among 191 to 666 (from Column B), and in cell E1 there is a formula that gives you the interpolation result from Column A, using the formula:

    =ROUND(INDEX(A1:A16,MATCH(D1,B1:B16,1))+(D1-INDEX(B1:B16,MATCH(D1,B1:B16,1)))/((INDEX(B1:B16,MATCH(D1,B1:B16,1)+1)-INDEX(B1:B16,MATCH(D1,B1:B16,1)))/2),1)

    examples:

    if you set 236 value in cell D1, the result in cell E1 will be 4
    if you set 410 value in cell D1, the result in cell E1 will be 16.5
    etc.

    But when you set 666 value in cell D1, the result in cell E1 will be #REF!. In this case, how could you fix this in order to get 30 instead of #REF! ?.

    Thanks in advance.
    "Strong is who knows his own capacities, but is still stronger who also knows his own weaknesses". Deladier M.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,644

    Re: Problem with Interpolation formula

    What version do you use (would be nice to state in profile).

    If XL 2007 you can use =IFERROR(formula, 30)

    If not you can test first for MAX in value: =IF(D1=MAX(B1:B16,MAX(A1:A16), formula)

  3. #3
    Registered User
    Join Date
    04-27-2005
    MS-Off Ver
    2003
    Posts
    16

    Re: Problem with Interpolation formula

    Ok, I'm using Excel 2003. Thanks, let me try it.

  4. #4
    Registered User
    Join Date
    04-27-2005
    MS-Off Ver
    2003
    Posts
    16

    Re: Interpolation formula

    Thanks, it works fine.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Interpolation formula

    Quote Originally Posted by Deladier View Post
    =ROUND(INDEX(A1:A16,MATCH(D1,B1:B16,1))+(D1-INDEX(B1:B16,MATCH(D1,B1:B16,1)))/((INDEX(B1:B16,MATCH(D1,B1:B16,1)+1)-INDEX(B1:B16,MATCH(D1,B1:B16,1)))/2),1)
    I note that your formula is based on increments of 2 in A1:A16, if that range doesn't have increments of 2 then your formula won't give the correct results. This formula will allow any increments in that column

    =ROUND(IF(D1=B$16,A$16,LOOKUP(D1,B$1:B$15,A$1:A$15+(D1-B$1:B$15)/(B$2:B$16-B$1:B$15)*(A$2:A$16-A$1:A$15))),1)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1