+ Reply to Thread
Results 1 to 5 of 5

Time between 2 dates and times

  1. #1
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Time between 2 dates and times

    Hi, I have a col with pick dates (K) and a col with pick times(J) I want to find the how much time it took the picker to pick all the orders in a week.

    Trying this:Getting a type mismatch error

    Please Login or Register  to view this content.
    Can someone advise, thank you Mike
    Last edited by realniceguy5000; 02-17-2012 at 12:03 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Time between 2 dates and times

    Hi Mike,

    You could use:
    Please Login or Register  to view this content.
    However that would include all hours of the day, every day. So Feb 16, 2012 8:00 AM through Feb 18, 2012 10:00AM would result in 50. If you only wanted to count a max of 8 hours per day, you could probably do something along the lines of:
    Please Login or Register  to view this content.
    There are probably other alternatives for dealing with specific hours (e.g. 8am-5pm, or multiple shifts, etc).

  3. #3
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Time between 2 dates and times

    Thanks Paul, It appears to work as you said. However thinking this through a bit more since I dont know for sure what hours they will be working each day I decided to loop through the range and add up all the working minutes they work.

    The problem I have now is I am returning the number of minutes but I want to place how many hours and minutes back into the cell as hh:mm.

    I'm trying this after I get the minutes total(myresults) in this case its 2971 minutes which is 49 hours and 31 minutes
    Please Login or Register  to view this content.
    Now I want to place 49:31 back in the cell, This is the part that isnt working not sure which method is correct to use or if both are wrong because it appears results is a text value "49:31" and not a time value, but when I change the format of the cell it becomes 01:31

    Can someone advise which is the corret method or another method?

    Thank You, Mike

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

    Here is how it's layed out in the script which seems to work till I change the format of the cell?

    Please Login or Register  to view this content.

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Time between 2 dates and times

    You need:
    Please Login or Register  to view this content.
    to display more than 24 hours as hours.
    Good luck.

  5. #5
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Time between 2 dates and times

    Oh Good Grief...my bad...

    Thanks for pointing that out.

    Mike

+ 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