Solved

Excel formula calculate difference in two datetimes, answer in hours and tenths (decimal)

Posted on 2011-09-15
4
333 Views
Last Modified: 2012-08-13
How can I create a new column that contains the difference between two datetime values, with the answer expressed in hours and tenths-of-hours?

Example:
Begin Date (in A1) = 6/9/2011  12:04:00 PM
End Date (in B1) = 7/1/2011  12:15:00 PM

Hours Spent = B1 - A1

The answer is 528:11 when I custom-format it with [hh]:mm , but I need it to show as 528.2 (decimal format).

Thanks in advance!
0
Comment
Question by:notawahoo2
  • 2
4 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 36543766
To display hours with a decimal or fractional part divide the value by 24 and format the result as a number as illustrated below.

   =A1/24

Kevin
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36543825
I think you need to multiply by 24 Kevin, so for the above try this formula

=(B1-A1)*24

format result cell as number with 1 decimal place

If you need result to be exact 10ths (and not just displayed that way) use ROUND, too, i.e.

=ROUND((B1-A1)*24,1)

regards, barry
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 36543830
Dang. Thanks Mr. Barry.
0
 

Author Closing Comment

by:notawahoo2
ID: 36544015
So Simple!  

Thanks!!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now