Function ASTM_Table54_VCF(Density15 As Double, TempObs As Double, ProductType As String) As Double Dim alpha As Double, dt As Double Dim K2 As Double If ProductType = "Crude" Then K2 = 341.0957 ElseIf ProductType = "Product" Then K2 = 594.5418 Else ASTM_Table54_VCF = CVErr(xlErrNA) Exit Function End If If Density15 <= 0 Then ASTM_Table54_VCF = CVErr(xlErrValue) Exit Function End If
Better: use the official polynomial from API Chapter 11.1.4: astm table 54 excel
For Crude Oils:
| Coefficient | Value | |-------------|-------| | K0 | 341.0957 | | K1 | 0.0 | | K2 | 0.0 | Function ASTM_Table54_VCF(Density15 As Double