+ Reply to Thread
Results 1 to 5 of 5

Converting AM PM into 24hr

  1. #1
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Converting AM PM into 24hr

    Hi All,

    I've having a nightmare trying to convert AM PM times into 24hr, I keep receiving VALUE errors (Column C)

    Column D is the result I'm trying to achieve

    Thanks

    Mdn
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,977

    Re: Converting AM PM into 24hr

    When I open your file I do not get any errors. Column C is just data values, so cannot return #VALUE errors.

    The data in column B is text, rather than time values. The reason is that the 5th character looks like a space, but is actually a non-printable character of some kind (maybe a non-breaking space, not sure), so Excel does not realize this is supposed to be a time value. How are you getting the time data into your file?

    You can either clean up your data (preferred), or address this at the formula level.

    To clean up your data:
    Edit a cell containing the time in column B. Copy the space--just the space character.
    Go to Find & Replace
    In Find, highlight the box and Paste. This will paste the false space character.
    In Replace, highlight the box and press SPACE.
    Then Replace All.

    To use a formula to calculate the date + time:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Converting AM PM into 24hr

    Cheers Jeff, that formula works great

    For context the time data is from gmail

    Attachment 850330

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,977

    Re: Converting AM PM into 24hr

    Just for completeness, the data could also be cleaned up with VBA, but if you're happy with the formula we'll stop there.

  5. #5
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: Converting AM PM into 24hr

    @6StringJazzer's formula is shorter, but I would have done it this more "old school" way...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. recognising 24hr time
    By dodger999 in forum Excel General
    Replies: 2
    Last Post: 04-23-2011, 06:21 PM
  2. 24Hr times
    By Sandpit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-24-2011, 03:37 PM
  3. time 24hr
    By ianm34 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-13-2010, 07:34 PM
  4. Converting a time value to 24hr Clock
    By Sugar Ape in forum Excel General
    Replies: 6
    Last Post: 10-09-2009, 05:26 AM
  5. 24hr date error
    By ukphoenix in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-15-2007, 07:57 AM
  6. 24hr moving average
    By Nadia in forum Excel General
    Replies: 1
    Last Post: 11-28-2005, 06:35 PM
  7. [SOLVED] code for 24hr clock?
    By Skullcramp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2005, 08:45 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