+ Reply to Thread
Results 1 to 5 of 5

autocalculating military Date time group

Hybrid View

  1. #1
    Registered User
    Join Date
    12-23-2014
    Location
    michigan
    MS-Off Ver
    2010
    Posts
    1

    autocalculating military Date time group

    Hello all,
    So glad to have discovered this forum. I am really hoping you all can help me with a couple issues i am having. I am currently in the miltary in North Carolina trying to make a spreadsheet for parts tracking information. One thing i really need help on is how to create a formula to auto calculate military date time groups. Format as follows DD(double digit Day)HH(double digit hour)MM(Double digit minute)Z(time format)MON(current month three letter)YR(two digit year identifier) so example: how many hours are there between 230400ZDEC14 and 210300ZDEC14? i can do it manually. However, it would really help me out if any of you had a solution. Thank you in advance.

  2. #2
    Forum Contributor
    Join Date
    03-11-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    379

    Re: autocalculating military Date time group

    Hi John,

    Consider values in cells A1 & B1; the formula would be
    Formula: copy to clipboard
    =MID(A1,3,2)-MID(B1,3,2)


    Regards,
    AM

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: autocalculating military Date time group

    Ashishmehra2010 that doesn't seem to take into account these are different days hence another 48 hours (23 - 21) x 24
    Happy with my advice? Click on the * reputation button below

  4. #4
    Forum Contributor
    Join Date
    03-11-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    379

    Re: autocalculating military Date time group

    Hi Crooza,

    Sorry its my mistake.

    Check this
    Formula: copy to clipboard
    =(LEFT(A1,2)-LEFT(B1,2))*24+(MID(A1,3,2)-MID(B1,3,2))


    Regards,
    AM

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: autocalculating military Date time group

    Try this to convert your code to a date /time, and this will take into account the day, year and month too

    =DATE((2000+VALUE(RIGHT(A1,2))),VLOOKUP(MID(A1,8,3),{"Jan",1;"Feb",2;"Mar",3;"Apr",4;"May",5;"Jun",6;"Jul",7;"Aug",8;"Sep",9;"Oct",10;"Nov",11;"Dec",12},2,0),LEFT(A1,2))+MID(A1,3,2)/24
    If you use this to calculate Cells a1 and B1 you can subtract one from the other and multiply by 24 to calculate the hours

    if you want to do this in one entire formula then this monster will work

    =((DATE((2000+VALUE(RIGHT(A1,2))),VLOOKUP(MID(A1,8,3),{"Jan",1;"Feb",2;"Mar",3;"Apr",4;"May",5;"Jun",6;"Jul",7;"Aug",8;"Sep",9;"Oct",10;"Nov",11;"Dec",12},2,0),LEFT(A1,2))+MID(A1,3,2)/24)-(DATE((2000+VALUE(RIGHT(A2,2))),VLOOKUP(MID(A2,8,3),{"Jan",1;"Feb",2;"Mar",3;"Apr",4;"May",5;"Jun",6;"Jul",7;"Aug",8;"Sep",9;"Oct",10;"Nov",11;"Dec",12},2,0),LEFT(A2,2))+MID(A2,3,2)/24))*24
    Last edited by Crooza; 12-23-2014 at 01:22 AM.

+ 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] Converting Text to Military Date Time Group Format
    By ET1CARNES in forum Excel General
    Replies: 9
    Last Post: 04-12-2014, 08:51 AM
  2. Military date time group subtraction
    By elothian in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-08-2013, 05:59 AM
  3. [SOLVED] Covert date/time to military time hour only
    By toontown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-03-2013, 01:05 PM
  4. Simple way to convert military time to standard where military has no colon
    By salvator in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2011, 10:27 AM
  5. Replies: 5
    Last Post: 10-28-2010, 03:24 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