I used below logic for one of my projects on status closed ,but it was to display the time difference in hours and mins on user fields .I am not sure how the exact calculation is done for the system fields you were looking for ,but this might give an idea of calculation logic
If Bug_Fields("BG_STATUS").Value ="Closed" Then
'Assigned the detected date to the variable.
DateOpened = Bug_Fields("BG_DETECTION_DATE"). Value
'Assigned the closed date to the variable.
DateClosed = Bug_Fields("BG_CLOSING_DATE").Value
'Calculate the difference in hours between open date and closed
TimeDifferenceHours = DateDiff("h",DateOpened,DateClosed)
'Calculate the Difference in minutes between open date and closed
'TimeDifferenceMinutes = DateDiff("n",DateOpened,DateClosed)
Bug_Fields("BG_USER_01").Value = TimeDifferenceHours
'Bug_Fields("BG_USER_02").Value = TimeDifferenceMinutes
End If