Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2017, 04:27 PM
DBenz DBenz is offline subtract date and time and convert to decimal hours ? Windows 7 64bit subtract date and time and convert to decimal hours ? Office 2010 32bit
Advanced Beginner
subtract date and time and convert to decimal hours ?
 
Join Date: Dec 2014
Posts: 66
DBenz is on a distinguished road
Default subtract date and time and convert to decimal hours ?


Hi,
column A is time format, column B is date format, column C is duration in decimal hours of that pair from the row above.

A B C
1 12:45:00 14-Jan-2017
2 00:30:00 16-Jan-2017 35.75

what formula to use in C to get the duration as decimal hours please ?

I see in another thread =MOD(A63-A62,1)*24 to crossover a day but poster hadnt a date column , I have more than 1 day gaps !

DBenz
Reply With Quote
  #2  
Old 01-20-2017, 10:42 PM
xor xor is offline subtract date and time and convert to decimal hours ? Windows 10 subtract date and time and convert to decimal hours ? Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

=(A2-A1)*24 works for me.
Reply With Quote
  #3  
Old 01-21-2017, 07:41 AM
NoSparks NoSparks is offline subtract date and time and convert to decimal hours ? Windows 7 64bit subtract date and time and convert to decimal hours ? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Quote:
i have more than 1 day gaps !
Try
= ((B2+A2)-(B1+A1))*24
Reply With Quote
  #4  
Old 01-21-2017, 08:45 AM
xor xor is offline subtract date and time and convert to decimal hours ? Windows 10 subtract date and time and convert to decimal hours ? Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

@NoSparks

You are right. I misread it to have both time and date in one cell.
Reply With Quote
  #5  
Old 01-26-2017, 04:37 AM
DBenz DBenz is offline subtract date and time and convert to decimal hours ? Windows 7 64bit subtract date and time and convert to decimal hours ? Office 2010 32bit
Advanced Beginner
subtract date and time and convert to decimal hours ?
 
Join Date: Dec 2014
Posts: 66
DBenz is on a distinguished road
Default

Hi,
created the cells with time format A and date format B and general C and got #value! so made C number format 2 dec places still get #value!

ah solved it, I had done a test lower down and of course the row numbers are not 1 and 1, silly me !

DBenz
Reply With Quote
  #6  
Old 01-26-2017, 05:38 AM
jeffreybrown jeffreybrown is offline subtract date and time and convert to decimal hours ? Windows Vista subtract date and time and convert to decimal hours ? Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

That tells me the time/date may not actually be numbers.

You can verify this by using ISNUMBER

Try...

=ISNUMBER(A1)

Do you get false or true? Try this also with what's in B1.

If you get false, you may have a time/date which looks like a number, but in reality is text. You need to convert to text or check to see if you have any extra spaces.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert [h]:mm:ss to Decimal Hours to Count FTE for Month Ethan2015 Excel 2 09-18-2015 03:55 AM
Formula for decimal hours from two date time entries DBenz Excel Programming 0 01-15-2015 05:52 AM
subtract date and time and convert to decimal hours ? Converting decimal to hours jhwtsang Excel 4 05-16-2011 01:36 PM
subtract date and time and convert to decimal hours ? Date and time calcs excluding non-working hours mrsatchmo Excel 1 01-26-2011 08:50 AM
subtract date and time and convert to decimal hours ? Convert hours in decimal ghostones Excel 1 12-29-2009 09:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft