Forum Discussion

zachary_king355's avatar
zachary_king355
Copper Contributor
Sep 18, 2019
Solved

Convert custom date format <day> <hour>:<minute>:<second> to something workable in excel?

hi Team,   looking for some help here!  have a data file which has 3 columns measuring a specific time and I need to calulate the difference between them.  the challenge i'm having is that the form...
  • SergeiBaklan's avatar
    SergeiBaklan
    Sep 18, 2019

    zachary_king355 

    You have texts, not datetime (which is actually an number in Excel). To receive the difference in seconds you need to parse these texts like

    =IFERROR((LEFT(D5,2)-LEFT(C5,2))+RIGHT(D5,8)-RIGHT(C5,8),"")

    and apply to the resulting cell [ss] custom format.

    IFERROR returns empty string if you have error in result, that happens if one of the texts is empty.

     

    Alternatively you may keep General format and convert result to seconds as

    =IFERROR( (LEFT(D5,2)-LEFT(C5,2)+RIGHT(D5,8)-RIGHT(C5,8) )*60*60*24,"")

     

    Please check in attached file.

Resources