PC Review


Reply
Thread Tools Rate Thread

Calculate the difference betwen two columns -two dates

 
 
Chi
Guest
Posts: n/a
 
      24th Mar 2010
Hi,

I would like to calculate the hours between two columns: First Contact (G)
and Appointment (H) with (m/d/yyyy) h:m AM/PM) format.

First Contact (G) Appointment (H) (J) (= H-G)
1/2/2010 10:00 AM 1/3/2010 10:00 AM 0:00
1/1/2010 8:00 AM 1/1/2010 9:00 AM 1:00
1/1/2010 8:15 AM 1/1/2010 8:30 AM 0:15

I added the formula (=H-G) on column J to calculate the difference between
(H) and (G) However, I don't understand why (1/2/2010 10:00 AM) (1/3/2010
10:00 AM)=0:00. It should be 12 hours.( the first line of my example). The
last two lines are correct, but the first line is wrong. Please help.
Thanks
Chi

On the column



 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      24th Mar 2010
That first answer is actually 24 hours difference, which wraps as 1
day and this is not shown because of the way the cell is formatted.
Highlight column J, and then apply a Custom format to those cells of:

[h]:mm

The square brackets around the h prevents the wrapping of 24 hours
into days, so you should see 24:00.

Hope this helps.

Pete

On Mar 24, 3:36*pm, Chi <C...@discussions.microsoft.com> wrote:
> Hi,
>
> I would like to calculate the hours between two columns: First Contact (G)
> and Appointment (H) with (m/d/yyyy) h:m AM/PM) format.
>
> First Contact (G) * * * * *Appointment (H) * * * * * * * * * * *(J) *(= H-G)
> 1/2/2010 10:00 AM * * * 1/3/2010 10:00 AM * * * * * * * 0:00
> 1/1/2010 8:00 AM * * * *1/1/2010 9:00 AM * * * * * * * *1:00
> 1/1/2010 8:15 AM * * * *1/1/2010 8:30 AM * * * * * * * *0:15
>
> I added the formula (=H-G) on column J to calculate the difference between
> (H) and (G) However, I don't understand why (1/2/2010 10:00 AM) (1/3/2010
> 10:00 AM)=0:00. It should be 12 hours.( the first line of my example). The
> last two lines are correct, but the first line is wrong. Please help.
> Thanks
> Chi
>
> On the column


 
Reply With Quote
 
Reg
Guest
Posts: n/a
 
      24th Mar 2010
if you press F1 and search for Hours you will find the help text:


1
2
A B
Start time End time
6/9/2007 10:35 AM 6/10/2007 3:30 PM
Formula Description (Result)
=INT((B2-A2)*24) Total hours between two times (28)
=(B2-A2)*1440 Total minutes between two times (1735)
=(B2-A2)*86400 Total seconds between two times (104100)
=HOUR(B2-A2) Hours between two times, when the difference does not exceed
24. (4)
=MINUTE(B2-A2) Minutes between two times, when the difference does not
exceed 60. (55)
=SECOND(B2-A2) Seconds between two times, when the difference does not
exceed 60. (0

RegMigrant

"Chi" wrote:

> Hi,
>
> I would like to calculate the hours between two columns: First Contact (G)
> and Appointment (H) with (m/d/yyyy) h:m AM/PM) format.
>
> First Contact (G) Appointment (H) (J) (= H-G)
> 1/2/2010 10:00 AM 1/3/2010 10:00 AM 0:00
> 1/1/2010 8:00 AM 1/1/2010 9:00 AM 1:00
> 1/1/2010 8:15 AM 1/1/2010 8:30 AM 0:15
>
> I added the formula (=H-G) on column J to calculate the difference between
> (H) and (G) However, I don't understand why (1/2/2010 10:00 AM) (1/3/2010
> 10:00 AM)=0:00. It should be 12 hours.( the first line of my example). The
> last two lines are correct, but the first line is wrong. Please help.
> Thanks
> Chi
>
> On the column
>
>
>

 
Reply With Quote
 
stumac
Guest
Posts: n/a
 
      24th Mar 2010
Hi Chi, surely the first line of your example should return 24:00?

if it is over 23:59 excel will start at 00:00 again, try changing the format
of your cells to [hh]:mm

Hth
Stu

"Chi" wrote:

> Hi,
>
> I would like to calculate the hours between two columns: First Contact (G)
> and Appointment (H) with (m/d/yyyy) h:m AM/PM) format.
>
> First Contact (G) Appointment (H) (J) (= H-G)
> 1/2/2010 10:00 AM 1/3/2010 10:00 AM 0:00
> 1/1/2010 8:00 AM 1/1/2010 9:00 AM 1:00
> 1/1/2010 8:15 AM 1/1/2010 8:30 AM 0:15
>
> I added the formula (=H-G) on column J to calculate the difference between
> (H) and (G) However, I don't understand why (1/2/2010 10:00 AM) (1/3/2010
> 10:00 AM)=0:00. It should be 12 hours.( the first line of my example). The
> last two lines are correct, but the first line is wrong. Please help.
> Thanks
> Chi
>
> On the column
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate difference between dates SylvieB Microsoft Access 5 11th Aug 2009 09:29 PM
Calculate number of codes betwen dates Danielah21 Microsoft Excel Worksheet Functions 4 18th Oct 2008 12:59 AM
calculate difference between 2 dates nikko Microsoft Excel Worksheet Functions 16 11th Sep 2008 11:15 AM
Calculate difference between to dates Clemens Microsoft Access Getting Started 2 17th Apr 2008 09:16 PM
Calculate a difference in dates tony Microsoft Access Forms 1 24th Nov 2003 06:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:35 PM.