# Calc - Total Number of Days + Hrs in Date Range [closed]

Hi I am attempting to make a spreadsheet to calculate the total number of days + hours passed between a date range. To do this, I have a multiple colomns.

- Opening Date
- Closing Date
- Opening Hour
- Closing Hour

Is there a way for me to calculate Total Days and Total Hours based on the aforementioned columns.
When I tried the =datediff with the formula `=datediff(o2,p2,d)`

i get a #NAME? error, where O2 is the cell for Opening Date and P2 is the cell for Closing Date.
No idea how to calculate the total number of hours if the number of hours exceeds over 24 hours, which it does in this case.

Help :)

Sorry, I just realized I overthought the Date function unnecessarily. I managed to get the total number of days by just subtracting P2 from O2 with =P2-o2 as the formula and then formatting the cell as a number. But I am unable to do the time.