smide
Board Regular
- Joined
- Dec 20, 2015
- Messages
- 164
- Office Version
- 2016
- Platform
- Windows
Hello.
In row 2 there are a time stamps and in row 3 I have a values for each of those stamps.
Example.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]Time stamps[/TD]
[TD="align: center"]48[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]39[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"]33[/TD]
[TD="align: center"]30[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD] Values [/TD]
[TD]2.63[/TD]
[TD]2.53[/TD]
[TD]2.48[/TD]
[TD]2.44[/TD]
[TD]2.60[/TD]
[TD]2.67[/TD]
[TD]2.69[/TD]
[/TR]
</tbody>[/TABLE]
With a simple hlookup formula I could find value for a let say time stamp 39 (exact match), =hlookup(39,B2:H3,2,FALSE) and the result is 2.44.
However sometimes I need to find value for the closest time stamp in row 2, so if I need value for time stamp 38 (which of course does not exist in row 2) then I'm expecting that result should be also 2.44 because
39 is closest value from row 2. Also for let say time stamp 44 result is 2.53 (45 is closest number from row 2) and so on...
I'm asking this because simple change from FALSE to TRUE in hlookup formula does not solve issue, so I would like a formula (if possible) for this problem.
Note: the range of values and time stamps (rows 2 and 3) may contain zero values or blank cells and if that happens then the whole column is either zero or blank
In row 2 there are a time stamps and in row 3 I have a values for each of those stamps.
Example.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]Time stamps[/TD]
[TD="align: center"]48[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]42[/TD]
[TD="align: center"]39[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"]33[/TD]
[TD="align: center"]30[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD] Values [/TD]
[TD]2.63[/TD]
[TD]2.53[/TD]
[TD]2.48[/TD]
[TD]2.44[/TD]
[TD]2.60[/TD]
[TD]2.67[/TD]
[TD]2.69[/TD]
[/TR]
</tbody>[/TABLE]
With a simple hlookup formula I could find value for a let say time stamp 39 (exact match), =hlookup(39,B2:H3,2,FALSE) and the result is 2.44.
However sometimes I need to find value for the closest time stamp in row 2, so if I need value for time stamp 38 (which of course does not exist in row 2) then I'm expecting that result should be also 2.44 because
39 is closest value from row 2. Also for let say time stamp 44 result is 2.53 (45 is closest number from row 2) and so on...
I'm asking this because simple change from FALSE to TRUE in hlookup formula does not solve issue, so I would like a formula (if possible) for this problem.
Note: the range of values and time stamps (rows 2 and 3) may contain zero values or blank cells and if that happens then the whole column is either zero or blank