Solved

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

Posted on 2011-09-15
4
349 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 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