Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-15
4
Medium Priority
?
368 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

670 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