View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_929_] Rick Rothstein \(MVP - VB\)[_929_] is offline
external usenet poster
 
Posts: 1
Default subtracting date/time

Try this formula...

=24*(B1-A1)

Rick


"Nathan" wrote in message
...
Hi all,

I have two columns: one is the "date time" a task began and the other is
the
"date time" the task ended. I want to measure the difference in hours.

For example, in A1 I have "6/28/2008 15:44" and in B1 I have "7/1/2008
16:51" These cell values are based on a function
[=IF(AND(ISNUMBER(F66),ISNUMBER(G66)),F66+G66,"")] that has brought
together
separate date and time values from other columns.

To find the difference between these two cells, I tried simply subtracting
(which gave me another date-time value) and I tried the following formula
based on another spreadsheet I've used
[=IF(AND(ISNUMBER(A1),ISNUMBER(B1)),B1-A1,"")] but this gives me the
differences between the two times, but doesn't account for the difference
between dates.

Any thoughts?

Thanks,
Nathan