'==================================

'correlation calculation

 

Sub Main()

    TimeLag

    Correlation

End Sub

 

Private Sub TimeLag()

    For i = 2 To 11

        Sheet1.Cells(i, 4) = Sheet1.Cells(i + 1, 3)

    Next

End Sub

 

Private Sub Correlation()

    Sheet1.Cells(2, 7) = "=Correl(B2:B10, C2:C10)"

    Sheet1.Cells(2, 8) = "=Correl(B2:b10, D2:D10)"

End Sub

 

'==================================

'unit converstion

 

Function GtCToppm(x)

    GtCToppm = (x * 3.67 / 44) / (5135 * 10 ^ 3 / 28.9) * 10 ^ 6

End Function

 

Function ppmToGtC(x)

    ppmToGtC = x / 10 ^ 6 * (5135 * 10 ^ 3 / 28.9) / 3.67 * 44

End Function

 

Function CO2ToC(x)

    CO2ToC = x / 44 * 12

End Function