+ Reply to Thread
Results 1 to 22 of 22

Problem with time format

  1. #1
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Problem with time format

    I have a file with data from a cantiliver beam experiment. The problem is I am not able to use the time format which is in the file. I want to make a plot for the two values in coloum D and E against time (coloum C). Where the time goes from 0 sec at the first data point and to xx.xxx secounds at each row.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    You have too many colons ( : ). The Time format needs to be hh:mm:ss.000. The numbers are just seen as Text.

    In cell F3, next to your Table, put the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and format the cells in the column as "hh:mm:ss.000". Column F will be added to your Table. If you wish, you could copy and Paste Special Values and Formats over the original Column3.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    See the attached updated example.

    Personally, I'd remove the blank row 2 and all the blank rows in your table below the data. They don't add any value. Structured Tables automatically propagate formulae and formatting.
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    Note that the "dates" in Column2 are not true Dates and the "numbers" in Column4 and Column5 are not true numbers.

    See the attached example.
    Attached Files Attached Files

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Problem with time format

    Hi there,

    Just a further comment.

    Looking at your data, is it likely that the hour value will change throughout the course of a series of readings? If not, you can use the following formula (in cell F4) to convert your time values to seconds:

    Please Login or Register  to view this content.

    If neither the hour nor the minute value is likely to change, you can use the following formula in Cell F4:

    Please Login or Register  to view this content.

    This approach will keep the data values at a more "manageable" level.


    Regards,

    Greg M

  6. #6
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    I checked out your solution TMS, but when I did this the time value has changed to an incorect time it seems.
    Attached Images Attached Images

  7. #7
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    The time is simply the time of day the tests was conducted. therefore the hour might change if future tests are conducted just as a new hour is starting.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    Sorry, I copied the formula from one Table to the other and it added the original Table Name. The formula should just be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    See attached.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    Probably my skills is the problem here, but when I entered the new formula text the cell just goes blank with no value.

    Just to clearify, I attached a picture of what I want to get from the time data (I wrote the numbers manually as text, just for the picture)
    Attached Images Attached Images

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    See the attached.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    Seems one of the problems also was a problem with my defult unit settings. Your v4 works perfectly! thank you!

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    See attached
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    I found another problem. When the time is 11:15:45:001 the data is written as 11:15:46:1 which then is interpeted as 11:15:45:100. Is there a way of solving this?
    Thank you so much for all your help!

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    I don't see that:

    11:15:45:001 11:15:45.001

  16. #16
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    See picture.
    Thank you!
    Attached Images Attached Images

  17. #17
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    When the time is 11:15:45:001 the data is written as 11:15:46:1 which then is interpeted as 11:15:45:100.
    Ah, now I understand. Who or what writes/provides this data? Ideally, it needs to be corrected at source. As it stands, I think you'd need to check the length of the field and pad with one or two zeroes before substituting the point to convert it to time. Probably doable but I don't have time right now. It would be difficult to do if any of the other sections were not fixed at two digits.

  18. #18
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    OK, I think this resolves the latest issue:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    I guess the problem here is the number of variations, since both the hour minute and second, could be written as 1 or 2 digits.
    Attached Images Attached Images

  20. #20
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Problem with time format

    Like I said, fix it at source. Either that, or split hours, minutes, seconds and milliseconds using the colon as a separator, format them individually, and collate in timeformat.

    I'm afraid I can't keep working on this, catering for each variation as it turns up. You started with "nn:nn:nn:nnn", moved to "nn:nn:nn:??n", and now it can be "?n:?n:?n:?nn"

    For simplicity, the easiest way would be to add four helper columns, use a formula or Text to Columns to split the input cells, and build the time value from scratch.

  21. #21
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    Thank you for your help! Came alot further with it. Will try to solve this my self now.
    Cheers!

  22. #22
    Registered User
    Join Date
    11-10-2021
    Location
    Ålesundn Norway
    MS-Off Ver
    365
    Posts
    10

    Re: Problem with time format

    Thank you for your help! Came alot further with it. Will try to solve this my self now.
    Cheers!

+ 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. [SOLVED] Time format problem
    By tamskinner in forum Excel General
    Replies: 3
    Last Post: 07-10-2018, 02:01 AM
  2. [SOLVED] Time format problem
    By c00ly81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2015, 07:11 AM
  3. [SOLVED] Time format problem
    By Vimal Bhatt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2013, 02:50 AM
  4. problem with time format
    By pedram in forum Excel General
    Replies: 12
    Last Post: 12-20-2009, 02:37 PM
  5. Time format problem
    By Redwynne in forum Excel General
    Replies: 1
    Last Post: 09-26-2006, 08:47 AM
  6. Time format problem
    By chrisbarber1 in forum Excel General
    Replies: 8
    Last Post: 08-05-2006, 11:00 AM
  7. A Time Format Problem
    By PA in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-24-2006, 01:30 AM

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