Thanks for the reply Marcello.
Yes, you are right, 1000 is the expected result.
The logic is LEAST POSITIVE DIFFERENCE, as explained below:
[TABLE="width: 640"]
<colgroup><col span="10"></colgroup><tbody>[TR]
[TD]CVAL[/TD]
[TD]H4[/TD]
[TD]H3[/TD]
[TD]H2[/TD]
[TD]H1[/TD]
[TD]PP[/TD]
[TD]L1[/TD]
[TD]L2[/TD]
[TD]L3[/TD]
[TD]L4[/TD]
[/TR]
[TR]
[TD]998.05[/TD]
[TD]1014.25[/TD]
[TD]1008.67[/TD]
[TD]1004.32[/TD]
[TD]1000.04[/TD]
[TD]1000[/TD]
[TD]997.35[/TD]
[TD]993.25[/TD]
[TD]991.54[/TD]
[TD]990.28[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]16.2[/TD]
[TD]10.62[/TD]
[TD]6.27[/TD]
[TD]1.99[/TD]
[TD]1.95[/TD]
[TD]-0.7[/TD]
[TD]-4.8[/TD]
[TD]-6.51[/TD]
[TD]-7.77[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]H4-CVAL[/TD]
[TD]H3-CVAL[/TD]
[TD]H2-CVAL[/TD]
[TD]H1-CVAL[/TD]
[TD]PP-CVAL[/TD]
[TD]L1-CVAL[/TD]
[TD]L2-CVAL[/TD]
[TD]L3-CVAL[/TD]
[TD]L4-CVAL[/TD]
[/TR]
</tbody>[/TABLE]
Hope the explanation is clear!
[TABLE="width: 576"]
<tbody>[TR]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[TD="width: 64, align: right"][/TD]
[/TR]
</tbody>[/TABLE]