How to Convert Military Time to Standard Time in Google Sheets

Published on

When recording time, you may often use the military time format, which is a 24-hour format without AM/PM. In Google Sheets, you can use formulas or the formatting menu to convert military time to standard time (a 12-hour format with AM/PM).

In a 24-hour clock, time is written as HH:MM or HH:MM:SS. For example, 23:15 is equal to 11:15 PM in a 12-hour format. Sometimes, military time might also be entered as 231500, which corresponds to 23:15:00.

Let me show you how to convert military time to standard time in Google Sheets using both formulas and custom time formatting.

Convert Military Time to Standard Time Using Custom Time Formatting

To convert military time to standard time directly within a cell or cell range, you can apply custom formatting without using a formula. Follow these steps:

  1. Select the cell or range that contains the time.
  2. Click Format > Number > Custom Date and Time.
  3. Choose a format, such as 1:25 PM or 1:25:59 PM.
  4. Click Apply.

There is another option using custom number formatting:

Converting 24-hour time format to 12-hour format in Google Sheets
  1. Click Format > Number > Custom Number Format.
  2. Enter one of the following time formats in the provided field: hh:mm AM/PM or hh:mm:ss AM/PM.
  3. Click Apply.

Convert Military Time to Standard Time Using Formulas

When using a formula to convert military time to standard time, remember that the result will be in text format, which means it won’t be usable in calculations.

Assume the time in cell A1 is 23:22:12. The following formula in cell B1 will convert it to 11:22:12 pm:

=TEXT(A1,"HH:MM:SS AM/PM")

If you have military time entered as 232212 (without the standard colon delimiter separating hours, minutes, and seconds) in column A, you can convert it to standard time in a 12-hour format using the following formula:

Enter this formula in cell B1 and drag it down as needed:

=TEXT(TIMEVALUE(LEFT(A1, 2)&":"&MID(A1, 3, 2)&":"&RIGHT(A1, 2)),"HH:MM:SS AM/PM")

Explanation:

  • The LEFT, MID, and RIGHT functions extract two digits from the left, middle, and right of the string, respectively.
  • The extracted parts are combined using the ampersand (&), with “:” as the delimiter.
  • TIMEVALUE converts the resulting text into an actual time value, and TEXT formats it into a 12-hour time format.

Alternatively, you can use the following REGEXREPLACE formula to convert military time (entered without colons) to standard 12-hour time format:

=TEXT(TIMEVALUE(REGEXREPLACE(REGEXREPLACE(A1&"", "(\d{2})", "$1:"), ":$", "")),"HH:MM:SS AM/PM")

This formula uses REGEXREPLACE to insert colons after every two digits, except for the last pair and then converts it to standard time.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

More like this

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.