Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Subtracting date:hour from date:hour


I'm trying to subtract "30.06.05 00:00" from "31.07.05 23:59" and get
number of days and hours as result, but I cant seem to find the right
way to do this.

Im using Office XP (ie. Office 2002).
Any help is appreciated here :)

  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

To get the days use =INT(B1-A1)

formatted as general (not date)

where B1 is the later date/time and A1 the earlier, to get the time

=MOD(B1-A1,1), formatted as time



--
Regards,

Peo Sjoblom

(No private emails please)


wrote in message
oups.com...

I'm trying to subtract "30.06.05 00:00" from "31.07.05 23:59" and get
number of days and hours as result, but I cant seem to find the right
way to do this.

Im using Office XP (ie. Office 2002).
Any help is appreciated here :)


  #3   Report Post  
MK
 
Posts: n/a
Default

Thanks, but its not either days or hours Im after, but both :)

I need to work out a result that tells me how many days and hours there
are between the two times. I need to do further operations on the
result of the subtraction.

  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

You can just subtract and then use a custom format, then do whatever
calculations you want, the point is that the value you get is equal to 31
days 18 hours and 59 minutes, just do

=B1-A1

then custom format d tt:mm or d hh:mm whatever format you are using, I get
31 18:59 if I do that

--
Regards,

Peo Sjoblom

(No private emails please)


"MK" wrote in message
ups.com...
Thanks, but its not either days or hours Im after, but both :)

I need to work out a result that tells me how many days and hours there
are between the two times. I need to do further operations on the
result of the subtraction.


  #5   Report Post  
MK
 
Posts: n/a
Default

Oh, ok I misunderstood your first reply.
Thanks for explaining it, I got it to work :-)

brgds
Morten



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What formula is used for subtracting a range of different cells f. tim Excel Worksheet Functions 3 April 21st 23 10:07 PM
Subtracting weekdays from a date: Richard Excel Worksheet Functions 4 May 11th 05 02:44 AM
Subtracting Negative Numbers Carole O Excel Worksheet Functions 2 January 4th 05 06:31 PM
Defining a number in a cell by text then subtracting it by the tex Crowraine Excel Worksheet Functions 1 December 16th 04 07:49 AM
Adding Subtracting Time Formula-Horse Racing SMDIYDLI Excel Discussion (Misc queries) 1 December 13th 04 09:27 PM


All times are GMT +1. The time now is 03:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"