Subtracting date:hour from date:hour

  • Thread starter Thread starter morten.krog
  • Start date Start date
M

morten.krog

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 :)
 
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)
 
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.
 
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)
 
Oh, ok I misunderstood your first reply.
Thanks for explaining it, I got it to work :-)

brgds
Morten
 
Back
Top