+ Reply to Thread
Results 1 to 17 of 17

Calculating total time based on start and end time.

  1. #1
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Calculating total time based on start and end time.

    Hi,

    I am currently working with some data that include columns with start and end time of bus trips. The time-stamps don't come in a time cell format but rather in a general one.

    The problem is I cannot simply subtract those timestamps as sometimes the end date is on the next day and there is no full date data included, it is just the timestamps.

    I tried several things, with mixed results. For example I made an if function where in case "B (end time) < A (start time)" then "24+B-A" if not "B-A". The problem with this approach is that it treats the time-stamps as numbers and whereas for "o'clock" ones is totally fine, that is not the case where minutes are involved. Changing the cell format to date, solves the minutes problem but adds another since time is a 24 system which renders the formula above as simply useless.

    Any input would be appreciated.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,204

    Re: Calculating total time based on start and end time.

    Please post a sample file with clear explanation of what is required and expected results.

    To upload file, click "Go Advanced" then "Manage Attachments"

  3. #3
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Well here it is, the columns in question are "I" and "J". What I need is to estimate the total travel time based on those timestamps.

    Thank you
    Attached Files Attached Files
    Last edited by famin; 02-11-2016 at 05:46 AM. Reason: Attaching files

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Calculating total time based on start and end time.

    Hi
    Use these formula and forma the result as hh:mm (for row 5)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    or use
    =TEXT(-SUBSTITUTE(I5,".",":")+SUBSTITUTE(J5,".",":"),"hh:mm")

  5. #5
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Hi Jose,

    I am getting a formula error when inputting this formula in column "T".

    Thanks

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Calculating total time based on start and end time.

    Hi
    See the file START_END.xlsx

  7. #7
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Oh I see.

    Well that made format conversion and subtracting in one go.

    However there still is the original issue when the start time is on day A while the end time is on day B.

    You can see what I am talking about if scroll a little to those cells with a value error near the bottom of the document.

  8. #8
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Calculating total time based on start and end time.

    Hi
    Use
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Jose thanks again for the prompt reply.

    Perhaps there is something wrong with my Excel version (2007) because it again gives me an error when pasting the formula.

    Any ideas?

  10. #10
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Calculating total time based on start and end time.

    I do not know what's going on.
    See the file START_END.xlsx

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,204

    Re: Calculating total time based on start and end time.

    I tested both Jose's formulae in START_END.xlxs and they worked, even saving the file as "97-2003" version, so it's hard to see why you are having problems.

  12. #12
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Yes, I am not suggesting they do not work in general. I am just reporting that there might be some issue with my installation.

    I am attaching a couple of screenshots to show you what happens when I am pasting both variations of the formula.

    formula_error_1.JPG
    formula_error_2.JPG

    The error message is in Greek, but what it essentially is saying is that there is some error with the formula.

  13. #13
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Calculating total time based on start and end time.

    Hi
    Clarify me. When you download my file the formulas do not work?
    The screenshots you show are from a different file.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,204

    Re: Calculating total time based on start and end time.

    Why are first two rows of Column T "hh:mm" rather than numeric results? Is formula copied to wrong cell?

  15. #15
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Yes the updated file you uploaded works just fine. And not only that but when I am copying the formula in another cell on the same file there is no error message.

    START_END_2.JPG

    However when I paste the formula in the original file that is another story.

  16. #16
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Update

    When I am copying the formula from the file you provided with right click --> COPY and then paste it to the original file, then again it works fine.



    Update 2

    And then if for example I press ENTER while editing the formula, it stops to work and "hh:mm" takes its place as you can see here.
    Last edited by famin; 02-11-2016 at 09:47 AM.

  17. #17
    Registered User
    Join Date
    02-11-2016
    Location
    Athens, Greece
    MS-Off Ver
    2007
    Posts
    14

    Re: Calculating total time based on start and end time.

    Quote Originally Posted by JohnTopley View Post
    Why are first two rows of Column T "hh:mm" rather than numeric results? Is formula copied to wrong cell?
    Sorry missed that one, no actually it is not. As mentioned just by placing the cursor on the already typed formula and then pressing ENTER this is what happens.

+ 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. Replies: 9
    Last Post: 02-15-2015, 07:32 PM
  2. Calculating the start time based on known end time
    By Journeyman3000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-20-2014, 10:41 PM
  3. Calculating total time for individual with multiple start/end times
    By schnizz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2014, 02:45 PM
  4. Replies: 3
    Last Post: 12-19-2013, 06:49 AM
  5. Automatic generation of Start time, end time and total time in excel
    By dreamwarden in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2013, 08:03 PM
  6. Calculating END time based on start time, breaks, and hours to complete
    By sweedey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2012, 11:29 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

Tags for this Thread

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