Plip's Weblog

Phil Winstanley - British .NET chap based in Lancashire. Enjoys tea and tech. Working for Microsoft.

Excel DateDiff in Seconds

I needed to do some excel work today and had to write this forumula.

=(((HOUR(B3) * 60) * 60) + (MINUTE(B3) * 60) + SECOND(B3)) - (((HOUR(A3) * 60) * 60) + (MINUTE(A3) * 60) + SECOND(A3))

Hopefully others will find it useful.

Comments

Duncan said:

Or how about:

=(A3-B3) * 24 * 60 * 60

# January 15, 2007 1:20 PM

Matt ward said:

your mum is a batsman

# September 20, 2007 5:34 AM

Lester said:

It is not the same result, you get difference in decimal part.  For a exact result use the first.

# March 16, 2010 1:40 PM