Military Time (Get and Subtract) in Excel (Formula)


- Written by Puneet

Convert Normal Time into Military Time

You can use the TEXT function to convert a normal time into military time in Excel. In the following example, we have the time in cells A1 and A2. The first time is in AM and the second is in PM.


Now by using the text function, you can convert this time into military time and the formula would be as follows.


In the format argument, you have the “HHMM” format which is without a colon and shows the time as military time.

Get Military Time using Custom Formatting

To use the custom formatting, you need to select the cell or the range of cells where you want to get the military time.

  1. Once you select the cell, use the shortcut key Control + 1 to open the format options.
  2. Click on Custom to go to the custom formatting option.
  3. From here, click on the input box and format that you already have there.
  4. In the end, enter “HHMM” as a format and click OK.

Get the Excel File

Last Updated: December 01, 2023