+ Reply to Thread
Results 1 to 3 of 3

Macro to find the Earliest Start Time and Latest Finish Time during a period

  1. #1
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Macro to find the Earliest Start Time and Latest Finish Time during a period

    Dear All,
    I am using Excel 2013 and have a problem as shown in the attached sample

    I have data with Item No - Start Data - Start Time - Finished Date - Finished Time

    Please see the sample Sheet1 where I have shown my desired Output required in Col H to L
    In Col M I need to find the difference between finish time and start time

    If start time and finish time are recorded as 0:00:00 then it should not be considered in the output
    Also if there are erroneous entry eg Row 20 in the Sample data it should not be considered too in the output

    The macro can give the desired output on a new sheet. For explanation purpose I showed the output on the same sheet


    Hope to get some help
    Thanks in advance
    Rehana
    Attached Files Attached Files
    Last edited by rehana402003; 10-04-2018 at 06:41 AM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Macro to find the Earliest Start Time and Latest Finish Time during a period

    How do you know row 20 is in error? What rule is applied? If the year is not the same as the rest of the data for that item? What about a start time on December 31st of one year and January 1st of the next year? How do you want to handle if there are three different years for the group?

    We, as humans, can look at the data and say, "No, that doesn't look right." Computers need to be told specifically what isn't right.

    Here is one solution that ignores this question. I simply "zeroed out" the bad data.

    This solution makes use of an excel table (because they know how big they are and copy down formulas automatically) a couple of "helper columns" to combine the date + time and eliminate zero time values, and a pivot table to get the minimum start time and maximum end time.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Re: Macro to find the Earliest Start Time and Latest Finish Time during a period

    Thanks Dflak
    Your help has worked to a great extent

    Post Marked Solved. Rep added

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Calculate time taken from earliest start time and latest end time
    By escapes88 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-13-2018, 05:43 AM
  2. [SOLVED] Conditionl Formating to highlight time slots between start and Finish time.
    By excelrooky in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-25-2017, 02:39 AM
  3. Replies: 3
    Last Post: 02-10-2016, 07:26 PM
  4. Calculate finish time given start time, working hours and job duration
    By swanseaexcel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2012, 03:00 PM
  5. Ready Time, Start Time, Finish Time by user
    By teguigala in forum Excel General
    Replies: 3
    Last Post: 02-15-2012, 03:34 PM
  6. Replies: 6
    Last Post: 11-29-2011, 09:12 AM
  7. [SOLVED] template or formula for start time -finish time -total hours ple
    By cc in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-27-2006, 01:10 PM

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