Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good morning

    Can somebody help me with a formula please. I have 4 columns collection date dd/mm/yy (d1), collection time hh.mm (e1) and then the same format in f1 and g1 for delivery date and delivery time. I need to work out for about 43,000 records what the transit time was. The date columns are in date format and the collect / delivery times in number format.

    Thanks
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    For row 1, use the formula

    =F1-D1+(INT(G1)+MOD(G1,1)/0.6-INT(E1)-MOD(E1,1)/0.6)/24

    Format it with the time format of your preference, for example [h]:mm, then fill down.

    (It would have been better if you had used time format instead of number format for the times.)

  3. #3
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='794539' date='23-Sep-2009 12:42']For row 1, use the formula

    =F1-D1+(INT(G1)+MOD(G1,1)/0.6-INT(E1)-MOD(E1,1)/0.6)/24

    Format it with the time format of your preference, for example [h]:mm, then fill down.

    (It would have been better if you had used time format instead of number format for the times.)[/quote]
    Hi Hans

    Thank you for your input on this, I have b een desperately trying to get this to work but cannot, I have attached a simple cut down example that should now have the date and times in the correct format, any help will be greatly appreciated.
    Attached Files Attached Files
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    This time, columns E and G contain proper time values, but columns D and F don't contain date values but text strings. 24.02.09 is not a valid date unless your system settings use a point as date separator (such as in Germany).
    Please enter the dates in a format that your system settings recognize, such as 24/02/09 or 24-Feb-09.

  5. #5
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the quick repsonse Hans

    I have 30,000+ rows, what would you suggest is the easiest way of changing the format short of manually
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Replace . with / in the date columns.

    You'll have to modify the formulas because the data now look differently from what you originally made us believe.

    See the attached version.
    Attached Files Attached Files

  7. #7
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='794875' date='25-Sep-2009 14:50']Replace . with / in the date columns.

    You'll have to modify the formulas because the data now look differently from what you originally made us believe.

    See the attached version.[/quote]
    Terrific Hans

    Thanks so much

    I struggled for a while because I could not see for the life of me how I was going to change 122,210 . (periods) with a / but after some thought decided to highlight the 2 sets of data, cross my fingers, and do a find . and replace / and it worked,phew

    Have a good weekend
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  8. #8
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    For row 1, use the formula

    =F1-D1+(INT(G1)+MOD(G1,1)/0.6-INT(E1)-MOD(E1,1)/0.6)/24

    Format it with the time format of your preference, for example [h]:mm, then fill down.

    (It would have been better if you had used time format instead of number format for the times.)
    Hi Hans

    Sorry to bother you with this again but I seem to be getting some inaccurate results

    Column D is the start date and formatted dd/mm/yyy in the date format
    Column F is the end date and is formatted as above
    Column E is the start time and formatted as hh.mm.ss in the time format
    Column G is the end date and formatted as above

    So for example I have

    08/10/2009- 11:38:00- 12/10/2009- 11:38:00- in row 42 and the formula in H42 is

    =F42-D42+(INT(G42)+MOD(G42,1)/0.6-INT(E42)-MOD(E42,1)/0.6)/24

    But it returns 00:00:00

    Is it possible that you could identify from this information what I have done wrong?
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The time difference is 96 hours, but Excel by default displays clock time which doesn't go above 24 hours.
    Apply the custom format [h]:mm:ss to the cells in column H. The [h] specifies cumulative time.


  10. #10
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    The time difference is 96 hours, but Excel by default displays clock time which doesn't go above 24 hours.
    Apply the custom format [h]:mm:ss to the cells in column H. The [h] specifies cumulative time.
    Thanks as usual Hans

    The help files never seem to tell you these things, anyway I cheated and copied and pasted the data into the example you had sent me before and it worked :-)

    Ta
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

Posting Permissions

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