• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel formula to calcumate difference between 2 date time

Jagdev Singh

Active Member
Hi Experts

I am not able to pull the time difference between 2 date times

Example –

8/26/2015 22:05:00 PM

8/26/2015 22:30:00 PM


Ans – 0:25:00

I tried the formula –

=(B1-A1)*24

I am not able to get the result. Is there any alternative to get the desire output.

Regards,

JD
 
Oops, didn't realize you had 24 HR format combined with AM/PM. That's bad as Excel won't recognize it as valid time format.

In that instance you want to use formula below to strip out AM/PM portion.
=LEFT(B1,LEN(B1)-3)-LEFT(A1,LEN(A1)-3)

Format output cell as [h]:mm:ss
 
Hi Chihiro

Thanks for your formula, but it is giving some fraction value 0.041 instead of 1:00:00 as my desire output.

Regards,
JD
 
You need this part.
Format output cell as [h]:mm:ss

Right click on cell/range, select "Format Cells".
In Category choose "Custom", in "Type:" type in [h]:mm:ss

If having further issues, please upload sample file, so I can see what exactly is causing issue.
 
Back
Top