Calculating Time Difference in Microsoft Excel between Two Dates or Datetime
Hi everyone! This is my personal notes about calculating time difference between two dates using Microsoft Excel. I am using format Month-Date-Year Hour-Minutes as for the sample data.
1. Calculating Days between Two Dates or Datetime
You can simply use this formula
=INT(C3-B3)&" days "
Formula explanation:
- INT(C3-B3) : using function INT to convert a number to integer. The function takes a number as input and truncates any decimal values to the nearest integer. The C3 representing cells containing end date and B3 representing cells containing start date.
- &" days" : ampersand (&) operator used for joining seperated text or strings together. In this case, we adding word days at the end of the calculation results.
2. Calculating Days, Hour and Minutes between Two Dates or Datetime
To get additional data in hour and minutes, we will modify the first formula and it will look like this
=INT(C3-B3)&" days "&TEXT(C3-B3,"h"" hrs ""m"" mins """)
Formula explanation:
- INT(C3-B3) : using function INT to convert a number to integer. The function takes a number as input and truncates any decimal values to the nearest integer. C3 representing cells containing end date and B3 representing cells containing start date.
- &TEXT(C3-B3,"h"" hrs ""m"" mins """)" : ampersand (&) operator used for joining seperated text or strings together. In this case, we adding word days, hrs and minutes at the end of the calculation results. C3 representing cells containing end date and B3 representing cells containing start date.
Post a Comment for "Calculating Time Difference in Microsoft Excel between Two Dates or Datetime"