+ Reply to Thread
Results 1 to 10 of 10

Difference between two times - thank you!!

  1. #1
    Registered User
    Join Date
    08-09-2005
    Posts
    98

    Difference between two times - thank you!!

    Hello everyone

    I would really appreciate your help

    I have a client who weants to work out the total number of hours (not minutes) between two times. I have managed to do that with no problem using the formula =IF(A2>B2,B2-A2+1,A2+B2). However, this is where the problem starts.

    They want to multiply the number of hours with the number of men on the job, but the answer is wrong, and I cannot understand why. I have checked the formnat of the cell and changed it to see if that is the problem, but without success.

    I have copied it below

    Time in Time out No hours No of Men Total Man Hours
    12:00 03:00 15 2 6
    14:00 18:00 4 7 4


    Any help would be really apprciated

    Thank you
    Lynne
    Last edited by Lynneth; 11-10-2008 at 03:57 PM.

  2. #2
    Registered User
    Join Date
    08-09-2005
    Posts
    98

    Find the Difference between two times

    Hello everyone

    I would really appreciate your help

    I have a client who weants to work out the total number of hours (not minutes) between two times. I have managed to do that with no problem using the formula =IF(A2>B2,B2-A2+1,A2+B2). However, this is where the problem starts.

    They want to multiply the number of hours with the number of men on the job, but the answer is wrong, and I cannot understand why. I have checked the formnat of the cell and changed it to see if that is the problem, but without success.

    I have copied it below

    Time in Time out No hours No of Men Total Man Hours
    12:00 03:00 15 2 6
    14:00 18:00 4 7 4


    Any help would be really apprciated

    Thank you
    Lynne

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    format cell as general then "time*24*men" will give the number of man hours in your example c1*d1*24

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    duplicate post..tut tut
    answer already given
    but just a reminder hours*men*24 cell formatted general will give answer you want

  5. #5
    Registered User
    Join Date
    08-09-2005
    Posts
    98
    I am really sorry about the duplcate. Did not see one on the first post.

    Tried what you said (tried before) but unsuccessful.

    I got the answer 1.25 when I formatted it as General, ie 15 hours * 2 men

    Completely baffled!

    Help please (no more duplicates - promise)

  6. #6
    Registered User
    Join Date
    08-09-2005
    Posts
    98

    Thumbs up

    Just had another look at your formula.

    It worked, but could I ask you why I am multiplying by 24.

    Thank you so much
    Last edited by Lynneth; 11-10-2008 at 01:09 PM.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Lynneth,

    Duplicate posts merged. Please read the forum rules before posting again.

    Also please mark thread as solved

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  8. #8
    Registered User
    Join Date
    08-09-2005
    Posts
    98

    Mark as Solved

    How do I mark my question as solved. Have looked around, but cannot see how I do it

    Thanks
    Lynne

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    from here
    http://www.exceltip.com/st/Multiplyi...bers./802.html

    why must Hours x Rate be multiplied by 24? Excel treats time formats quite differently than regular numbers. One day = one whole time unit, therefore one hour = 1/24th of a whole unit, and we must multiply hours by 24 to achieve whole units of time

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Go to the first thread > click edit > advanced and top left there is a dropdown

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1