Solved

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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.

706 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

20 Experts available now in Live!

Get 1:1 Help Now