+ Reply to Thread
Results 1 to 10 of 10

Converting Text to Military Date Time Group Format

  1. #1
    Registered User
    Join Date
    04-12-2014
    Location
    Naples, Italy
    MS-Off Ver
    Excel 2010
    Posts
    9

    Converting Text to Military Date Time Group Format

    I am trying to find a way to have excel recognize text data input as date/time.
    Please Login or Register  to view this content.
    Where 02 Is the Date, 2020 is the time (military) Z is Zulu/GMT, MAR is Month and 14 is Year.
    I believe excel recognizes
    Please Login or Register  to view this content.
    but I have a spreadsheet (on a confidential system) with thousands of entries that I need to convert.
    Also, the people I have working for me are not remotely
    excel savvy and would reject the idea of entering data that way.
    I am also trying to keep the display the same format: ddhhmm"Z" MMM yy

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Converting Text to Military Date Time Group Format

    this will convert into a date

    =TEXT(MID(A1, 1,2 )&"/"&MID(A1,9,3)&"/"&MID(A1,13,2)&" "&MID(A1,3,2)&":"&MID(A1,5,2), "DD/MM/YY HH:MM")

    only issue is what happens if the time is 7:06 will it be entered as

    so all 4 characters
    020706Z MAR 14

    if not 4 characters - then this will not work

    and date what if single date ie 1 to 9 say 2nd march
    will this be
    020706Z MAR 02
    again my solution will not work , as it assumes the text is always in a certain position and a certain length

    otherwise I would produce quite a complicated formula using the Z as a reference and testing length
    so i will wait for other to answer as there maybe a much simpler way


    whats the default time zone on the machine ?
    not sure how that may effect the result
    AS I'm in UK and my PC is set to UK timezone BST
    Last edited by etaf; 04-12-2014 at 06:35 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    04-12-2014
    Location
    Naples, Italy
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Converting Text to Military Date Time Group Format

    etaf, thanks for the quick response

    The timezone on the machine is Central European Time (Rome)

    I tested:
    Please Login or Register  to view this content.
    The result I seem to get is an appropriate text representation of the data, but not an actual date/time values

    this is demonstrated in the attached spreadsheet, where I put the dataset into a table and attempted to sort by the converted data.

    So to clarify, my goals were to keep the same format, be able to enter the data in said format, and have excel recognize the entered DTG as Date/Time values.

    I appreciate the assistance,
    Brian
    Attached Files Attached Files

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Converting Text to Military Date Time Group Format

    edit - I see its not sorting as its sees as text ... mmmmmm

    try
    =DATEVALUE(TEXT(MID(A2,1,2)&"/"&MID(A2,9,3)&"/"&MID(A2,13,2),"DD/MM/YY"))+TIMEVALUE(TEXT(MID(A2,3,2)&":"&MID(A2,5,2),"HH:MM"))
    Last edited by etaf; 04-12-2014 at 07:43 AM.

  5. #5
    Registered User
    Join Date
    04-12-2014
    Location
    Naples, Italy
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Converting Text to Military Date Time Group Format

    DTG TEST.xlsx

    etaf, once again thanks for the quick reply

    It does not seem to be converting correctly. Also in my table, once it exceeds row 9, it exports the #VALUE! error. I'm trying to look at the code to see if I can debug as well.

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Converting Text to Military Date Time Group Format

    format the cells in column B

    Format>custom> DD/MM/YY HH:MM

    but what about dates 1-9 and times 1-12 or minutes 1-9

    is it going to be
    020706Z MAR 14

    for 7th Mar 14 at 7hrs and 6 mins am

    or
    276Z MAR 14
    Attached Files Attached Files
    Last edited by etaf; 04-12-2014 at 08:08 AM.

  7. #7
    Registered User
    Join Date
    04-12-2014
    Location
    Naples, Italy
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Converting Text to Military Date Time Group Format

    Okay, perfect, I believe this solves my questions.
    Last edited by ET1CARNES; 04-12-2014 at 08:29 AM.

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Converting Text to Military Date Time Group Format

    sorry, i dont know if you can
    probably with VBA http://support.microsoft.com/kb/107139 but not my expertise, and if using VBA , you could probably do the whole thing in VBA
    or you can use a font thats all caps
    Perpetua Titling MT

    UPPER() will just change the TEXT and when you convert back to a Datevalue - and format it will return to lowercase again

    what about my questions on days and times - otherwise this will not work at all anyway

  9. #9
    Registered User
    Join Date
    04-12-2014
    Location
    Naples, Italy
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Converting Text to Military Date Time Group Format

    Ah, sorry forgot to answer those. The format is always entered the same. In military signals, they always use to the same format to serialize which is the DTG. Thus, they always follow DDHHMM"Z" MMM YY format and we enter them as such for tracking. So in that case, this works perfectly for my intentions. Thanks again for the help. Also, that's a clever idea with the font. I'm also thinking about looking into the VBA option to convert the data text as it is entered, but also not my area of expertise.

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Converting Text to Military Date Time Group Format

    theres also

    Stencil
    Engravers MT
    Felix Titling
    Goudy Stout
    Showcard Gothic

    fonts for CAPS

+ 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. Military date time group subtraction
    By elothian in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-08-2013, 05:59 AM
  2. Converting Military time to days and hours having a start and end date
    By daisyhg00 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-09-2013, 06:46 PM
  3. [SOLVED] Military date format needs converting to civilian date value
    By mcranda in forum Excel General
    Replies: 3
    Last Post: 06-21-2013, 11:51 AM
  4. Converting Military Time
    By psewell in forum Excel General
    Replies: 4
    Last Post: 01-10-2008, 09:05 PM
  5. DOS Data in Excel Format with Date and Military Time in same cell
    By Jules in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-14-2005, 06:06 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