+ Reply to Thread
Results 1 to 3 of 3

Interpolating between dates

Hybrid View

  1. #1
    Registered User
    Join Date
    02-07-2007
    Posts
    13

    Interpolating between dates

    I have a data set with dates in one columns and a price in the second colum corresponding to that date.

    Not every date has a price, and the missing prices are not constant (ie no consistency in the number of days without a price)

    Is there an easy formula to be able to interpolate the numbers?

    Date______________Price
    01/01/01__________100
    01/02/01__________???
    01/03/01__________???
    01/04/01__________105
    01/05/01__________???
    01/06/01__________???
    01/07/01__________???
    01/08/01__________99

  2. #2
    Registered User
    Join Date
    02-07-2007
    Posts
    13

    Re: Interpolating between dates

    would anyone konw of a easier solution than simply taking the diff and dividing by the missing day count (not easy the the missing day count varies

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Interpolating between dates

    Maybe like this:

           ---A---- --B-- ---C---- ---D---- --E---
       3     Date   Price Helper 1 Helper 2 Interp
       4   01/01/01   100 #DIV/0!     5     100.00
       5   01/02/01   ???    2        5     101.67
       6   01/03/01   ???    2        5     103.33
       7   01/04/01   105    2        9     105.00
       8   01/05/01   ???    5        9     103.50
       9   01/06/01   ???    5        9     102.00
      10   01/07/01   ???    5        9     100.50
      11   01/08/01    99    5       #N/A    99.00
    C4 and down: =MATCH(2, 1/ISNUMBER(B$3:B3)) confirmed with Ctrl+Shift+Enter

    D4 and down: =MATCH(TRUE, ISNUMBER(B5:B$16), 0) + ROWS(D$3:D4) confirmed with Ctrl+Shift+Enter

    E4 and down: =IF(ISNUMBER(B4), B4, INDEX(E$3:E3, C4) + (INDEX(E$3:E16, D4) - INDEX(E$3:E3, C4) ) * (ROWS(INDEX(E$3:E4, C4):E4) - 1) / (INDEX(A$3:A16, D4) - INDEX(A$3:A16, C4) ) )
    Entia non sunt multiplicanda sine necessitate

+ 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