Convert Time into Military DTG from Multiple cells

dfull

New Member
Joined
May 16, 2023
Messages
4
Office Version
  1. 2016
Good morning!

I'm looking to convert normal time inputs into a single cell in a DTG format, i have an example of how the data is laid out on the spreadsheet below
1684227052002.png


In I3 is the time format i neet, pulling from A3, D3 (the date is embedded between other numbers I changed to stars. G3 is the start time and not needed, only there for reference. H3 is the ending time that needs to go into the conversion. The part that I got stuck on is that sometimes the end time is on the next date and I can't think of a solution where the formula could account for that, as shown in row 4, where the start time is at 1630 on the 16th, however the end time is at 0730 the 17th. Anybody know of a possible solution?

Thanks a million!
 
Hi Again,
I was just reminded of a "trick" with the MONTH function that makes your formula much easier. Try this:
Mr excel questions 35.xlsm
ABCDEFGHIJ
1MonthDaystart hrend hrvalueformatted value as text
2MAY**15*8001630ddhhmm mth yy151630 May 23151630 May 23
3JUN**15*18001630ddhhmm mth yy161630 Jun 23161630 Jun 23
dfull
Cell Formulas
RangeFormula
I2:I3I2=DATE(2023, MONTH(A2&"1"), MID(D2,3,2)) + IF(F2>G2,1,0) + TIME((G2/100),MOD(G2,100),0)
J2:J3J2=TEXT(DATE(2023, MONTH(A2&"1"), MID(D2,3,2)) + IF(F2>G2,1,0) + TIME((G2/100),MOD(G2,100),0),"ddhhmm mmm yy")
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I'm more certain about this one:

Mr excel questions 35.xlsm
ABCDEFGHIJ
1MonthDaystart hrend hrvalueformatted value as text
2MAY**15*8001630ddhhmm mth yy151630 May 23151630 May 23
3JUN**15*18001630ddhhmm mth yy161630 Jun 23161630 Jun 23
dfull
Cell Formulas
RangeFormula
I2:I3I2=DATE(2023, IF(A2="JAN",1, IF(A2="FEB",3, IF(A2="MAR",3, IF(A2="APR",4, IF(A2="MAY",5, IF(A2="JUN",6, IF(A2="JUL",7, IF(A2="AUG",8, IF(A2="SEP",9, IF(A2="OCT",10, IF(A2="NOV",11,12))))))))))), MID(D2,3,2)) + IF(F2>G2,1,0) + TIME((G2/100),MOD(G2,100),0)
J2:J3J2=TEXT(DATE(2023, IF(A2="JAN",1, IF(A2="FEB",3, IF(A2="MAR",3, IF(A2="APR",4, IF(A2="MAY",5, IF(A2="JUN",6, IF(A2="JUL",7, IF(A2="AUG",8, IF(A2="SEP",9, IF(A2="OCT",10, IF(A2="NOV",11,12))))))))))), MID(D2,3,2)) + IF(F2>G2,1,0) + TIME((G2/100),MOD(G2,100),0),"ddhhmm mmm yy")
That works! Thanks so much for you help and this doozy of a formula!
 
Upvote 0
hi, you're welcome, I"m happy you found a solution here.
Best Wishes!!!
 
Upvote 0

Forum statistics

Threads
1,214,548
Messages
6,120,141
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top