Solved

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

Posted on 2011-09-15
4
363 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

635 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