ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dates
  3. How to Convert Military Time in Excel (24-Hour Clock)

How to Convert Military Time in Excel (24-Hour Clock)

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To convert military time in Excel, turn the number into a real time. If A2 holds 1430, use =TIME(LEFT(TEXT(A2,"0000"),2),RIGHT(A2,2),0) and format the cell as h:mm AM/PM to show 2:30 PM. A shorter version is =--TEXT(A2,"00:00"). To go back, =TEXT(B2,"hhmm") turns a time into military text like 1430.

Key takeaways

  • Military time like 1430 is just a number to Excel. It must be converted before you can format it or do time maths.
  • TEXT(A2,"0000") adds the missing leading zero, so 930 becomes 0930 and LEFT can take the hours.
  • =TIME(LEFT(TEXT(A2,"0000"),2),RIGHT(A2,2),0) returns a real Excel time you can format any way.
  • =TEXT(B2,"hhmm") converts a real time back to military time as text.
  • For shifts that cross midnight, use =MOD(end-start,1)*24 to get hours.
On this page+
  1. How Excel stores time
  2. Convert military time to a real Excel time
  3. When the military time is stored as text
  4. Show times in 24-hour format
  5. Convert a normal time back to military time
  6. Hours between two military times
  7. Common military time mistakes
  8. Practise it

To convert military time in Excel, you turn a number like 1430 into a real time (2:30 PM) that Excel can format and calculate with. Military time is the 24-hour clock written as four digits with no colon. The core formula uses TEXT to add a leading zero, LEFT for the hours and RIGHT for the minutes. This guide shows that formula, a shorter version, how to go back the other way, and how to get the hours between two military times.

How Excel stores time#

Excel stores a time as a fraction of a day. 12:00 PM is 0.5, 6:00 AM is 0.25 and 6:00 PM is 0.75. The format you apply only changes how that fraction looks.

When you type 1430 into a cell, Excel doesn't see a time. It sees the number one thousand four hundred and thirty. If you format it as a time, the cell shows 0:00, because 1430 means 1,430 whole days with no time part. That's why military time needs a formula first.

Military times also lose their leading zero when typed as numbers. You type 0930, and Excel stores 930. The formulas below handle that.

Convert military time to a real Excel time#

Use TIME, which builds a time from hours, minutes and seconds. With the military time in A2:

Excel formula
=TIME(LEFT(TEXT(A2,"0000"),2),RIGHT(A2,2),0)

Here is what each part does:

PartWhat it doesFor 930
TEXT(A2,"0000")Turns the number into 4-digit text, adding a leading zero"0930"
LEFT(...,2)Takes the first two characters: the hours"09"
RIGHT(A2,2)Takes the last two characters: the minutes"30"
TIME(h,m,0)Builds the time from hours and minutes9:30 AM

Then format the result: press Ctrl+1 (Mac: ⌘1), choose Time, and pick a format such as 1:30 PM. These are the results for common values:

Military time in A2Result
6006:00 AM
9309:30 AM
14302:30 PM
221510:15 PM
512:05 AM

The TEXT function guide, LEFT function guide and RIGHT function guide cover each function's arguments.

A shorter formula#

TEXT can add the colon for you, and Excel can read the result as a time:

Excel formula
=--TEXT(A2,"00\:00")

TEXT(A2,"00\:00") turns 930 into the text "09:30". The backslash tells Excel to show the colon as a plain character. The double minus (--) turns that text into a number, the time 9:30 AM. Format the cell as a time, as before.

When the military time is stored as text#

If your data came from another system, the times may already be text with the leading zero, such as "0930". Text sits on the left of the cell by default. In that case, skip TEXT and split the text directly:

Excel formula
=TIME(LEFT(A2,2),RIGHT(A2,2),0)

To check what you have, use =ISTEXT(A2): TRUE means text. The guide to converting text to dates covers the same problem for dates.

If your times have seconds too, like 143015, make them six digits and take the middle with MID:

Excel formula
=TIME(LEFT(TEXT(A2,"000000"),2),MID(TEXT(A2,"000000"),3,2),RIGHT(A2,2))

That returns 2:30:15 PM.

Show times in 24-hour format#

You don't need a formula to display a real time on the 24-hour clock. Change the number format:

  1. Select the cells with real times.
  2. Press Ctrl+1 (Mac: ⌘1) and choose Custom.
  3. Type hh:mm for 14:30, or hhmm for 1430 with no colon.

The value stays the same; only the display changes. The guide to custom number formats explains every code, and leaving out AM/PM is what makes Excel use the 24-hour clock.

Convert a normal time back to military time#

To turn a real time into military time as text, use TEXT with the hhmm format:

Excel formula
=TEXT(B2,"hhmm")

9:30 AM becomes "0930" and 2:30 PM becomes "1430". The result is text, so it keeps the leading zero, which is what you want for reports and system uploads. If you need a number, wrap it in VALUE, but 0930 then becomes 930. The guide to TEXT function formats lists more format codes.

Hours between two military times#

Convert both times first, then subtract. For a shift that might cross midnight, wrap the subtraction in MOD:

Excel formula
=MOD(C2-B2,1)*24

If B2 is 10:00 PM (from 2200) and C2 is 6:00 AM (from 0600), plain subtraction gives a negative number. MOD with 1 wraps it into the next day, giving 0.3333 of a day. Multiply by 24 to get 8 hours. The guides to time differences and adding hours to a time cover totals over 24 hours and other edge cases.

Common military time mistakes#

These cause most wrong results:

  1. Formatting the number as a time. 1430 shows as 0:00. Convert it with a formula first.
  2. Using LEFT without TEXT. =LEFT(930,2) returns "93", not "09". Always pad the number to four digits.
  3. Midnight written as 2400. The TIME formula turns 2400 into 0, which is 12:00 AM; the shorter --TEXT formula returns 1, which is a full day. Change 2400 to 0000 in the data, or test for it with IF.
  4. Mixing text and numbers. A column that mixes "0930" text with 1430 numbers needs the TEXT version, which works on both.
  5. Expecting AM/PM in the result of TEXT. TEXT(B2,"hhmm") returns text. You can't do time maths on it until you convert it back.

Practise it#

Converting military time is really text work: padding with TEXT and splitting with LEFT and RIGHT. Practise TEXT and VALUE in a live spreadsheet, then practise LEFT, RIGHT, MID and LEN to split any code or time. Each lesson checks your formula as you type, and the exercise on this page converts a real military time.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Column B holds start times in military format. In C3, turn B3 into hh:mm text: use TEXT to make it four digits, take the first 2 with LEFT, add a colon, then the last 2 with RIGHT. The answer should read 09:30.

fx
ABCD
1
Shift
Start (military)
Start (hh:mm)
2
Early
600
3
Day
930
4
Late
1430
5
Night
2215
6
7
8

Tip: TEXT(B3,"0000") turns 930 into "0930". LEFT of that gives "09", RIGHT gives "30". Join them with &":"&.

Practise this in a lesson

LessonTEXT and VALUE: numbers to text and backFormat dates and dollar amounts inside sentences with TEXT, and turn digits stored as text into real numbers with VALUE.LessonLEFT, RIGHT, MID and LENSplit product codes and IDs into their parts by taking characters from the start, end or middle of the text.Function guideTEXTFormat dates, prices and percentages inside labels with Excel's TEXT function. Format codes, common mistakes and a live practice exercise.Function guideLEFTPull the first characters from a cell with Excel's LEFT: prefixes, initials and first names. Examples, pitfalls and live practice.Function guideRIGHTTake the last characters of a cell with Excel's RIGHT: account digits, file extensions and size codes. Examples, pitfalls and live practice.

Frequently asked questions

How do I convert military time to standard time in Excel?

+

Convert the number to a time with =TIME(LEFT(TEXT(A2,"0000"),2),RIGHT(A2,2),0), then format the cell as h:mm AM/PM. For 1430 the cell shows 2:30 PM.

How do I show 24-hour time in Excel?

+

Select the cells, press Ctrl+1 (Mac: Command+1), choose Custom and type hh:mm. Excel then shows 14:30 instead of 2:30 PM. Use hhmm to show 1430 with no colon.

Why does Excel show 0:00 when I format 1430 as a time?

+

Because 1430 is a number of days to Excel, not a time. Whole numbers have no time part, so they show as 0:00. Convert the number with a formula first.

How do I convert time to military time in Excel?

+

Use =TEXT(B2,"hhmm"). A time of 9:30 AM becomes the text 0930, and 2:30 PM becomes 1430. The result is text, so it keeps the leading zero.

How do I calculate hours between two military times?

+

Convert both to real times, then use =MOD(end-start,1)*24. MOD handles shifts that end after midnight, so 2200 to 0600 returns 8 hours.

Sources

  • TEXT function - Microsoft Support
  • LEFT, LEFTB functions - Microsoft Support
  • Create a custom number format - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How Excel stores time
  2. Convert military time to a real Excel time
  3. When the military time is stored as text
  4. Show times in 24-hour format
  5. Convert a normal time back to military time
  6. Hours between two military times
  7. Common military time mistakes
  8. Practise it

Keep reading

Dates· 6 min read

Calculate the Difference Between Two Times in Excel

To calculate the difference between two times in Excel, subtract the start time from the end time: =C2-B2. Format the result as h:mm to see hours and minutes, or multiply by 24 to get decimal hours: =(C2-B2)*24. For shifts that end after midnight, use =MOD(C2-B2,1) so the result is never negative.

Text· 6 min read

The TEXT Function: Format Numbers and Dates Inside Text

The TEXT function turns a number or date into text with the format you choose: =TEXT(value, format_text). For example, =TEXT(B2,"mmm d, yyyy") shows a date as Feb 3, 2025, and =TEXT(C2,"$#,##0.00") shows $1,250.50. Use it when you join numbers or dates to words, because & otherwise shows the raw stored number.

Dates· 5 min read

How to Convert Text to Dates in Excel

To convert text to a date in Excel, use =DATEVALUE(A2) or =VALUE(A2) when the text matches your computer's date format, then format the result as a date. For a whole column, use Data > Text to Columns and choose Date. For formats Excel can't read, like 20240315, rebuild the date with DATE, LEFT, MID and RIGHT.

More on dates

  • Get the Month Name From a Date in Excel
  • Month-to-Date Totals in Excel
  • How to Calculate Months Between Two Dates
  • Count Working Days With NETWORKDAYS and WORKDAY
  • Find the Next Monday (or Any Weekday) in Excel
  • How to Find the Nth Weekday of a Month in Excel
All dates articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free