Find a solution that satisfies most of my requirements using:
It is used =FILTER() to first delete empty lines where data is not available (thanks for the help from "pnuts").
AND =MATCH() to search for two consecutive rows from a filtered table. In my case, I was able to use this function because column A sorted and has no repetitions.
And then using the line formula to interpolate the values.
Thus, the output will look like this:
ABCDE 1 Date Weight FDdate FWeight IWeight 2 2015/05/09 2015/05/10 65.00
If cells C2 and D2 have the following range formula (a minor note: you can, of course, combine the following formulas if columns A and B are adjacent):
C2 =FILTER($A$2:$A$10, NOT(ISBLANK($B$2:$B$10))) D2 =FILTER($B$2:$B$10, NOT(ISBLANK($B$2:$B$10)))
Cells E2 through E10 contain the following line interpolation formula: [ y = y1 + (y2 - y1) / (x2 - x1) * (x - x1) ]:
E2 =(INDEX($D:$D, MATCH($A2, $C:$C, 1), 1)) +(INDEX($D:$D, MATCH($A2, $C:$C, 1) + 1, 1) - INDEX($D:$D, MATCH($A2, $C:$C, 1), 1)) /(INDEX($C:$C, MATCH($A2, $C:$C, 1) + 1, 1) - INDEX($C:$C, MATCH($A2, $C:$C, 1), 1)) *(INDEX($C:$C, MATCH($A2, $C:$C, 1), 1) - $A2) * -1
This solution does not work when the first B2 cell does not matter, resulting in the formula # N / A. All this would be much more effective if we had something like =INTERPOLATE_LINE( A2, $A$2:$A$10, $B$2:$B$10 ) in google spreadsheet, but unfortunately this does not exist . Please correct me if I missed this in my reading of the supported functions in google spreadsheet.