Forum Discussion

Mahdia_Akter's avatar
Mahdia_Akter
Copper Contributor
Apr 23, 2022

How to calculate time duration between two inputs

Suppose I write START in B2 and DONE in C2, rather than inputting the start and end time, is there any way to calculate the time interval between the texts I wrote START and DONE?

 

Thanks in advance.

3 Replies

    • Mahdia_Akter's avatar
      Mahdia_Akter
      Copper Contributor
      thanks but i was looking if not by inputting the time, but by writing start and end, if i can calculate interval between writing those texts
  • Mahdia_Akter 

    That would require VBA.

    An easier alternative would be to select B2 and press Ctrl+Shift+; when you start. This inserts the current time in B2.

    Select C2 and press Ctrl+Shift+; when you're done. This inserts the current time in C2.

    The formula =IF(OR(B2:C2=""),"",C2-B2) will return the time interval. The disadvantage is that the time is in hours and minutes only, no seconds.

Resources