Written by Allen Wyatt (last updated August 20, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
For some purposes, the military uses a variation of what is called a "Julian date" to record a specific date. This special date format consists of the year digits (with no leading zeros) followed by the absolute day of the year. Thus, 9 July 2019 would end up as 19190. This shows the year (19, which is for 2019) followed by the 190th day of the year (July 9).
The military is not alone in its use of such dates. Some other industries also rely on this type of date format. Excel, however, doesn't rely on this type of format. Instead, it uses more common formatting for the display of dates, and its own serial number format for the internal storage of dates. If you need to work with the Julian dates (perhaps you are in the military), you may wonder if there is a way to format dates in this manner.
The short answer is that there is no native way to do it. The custom formatting capabilities of Excel don't allow you to indicate a way to display the day of the year. So, this means that you must use a formula to return either a numeric value for the Julian date, or a text string that contains the Julian date.
If you want to return a text string containing the formatted date, then you can use a formula such as the following:
=RIGHT(YEAR(A1),2)&(A1-DATE(YEAR(A1),1,1)+1)
This formula assumes that cell A1 contains a regular Excel date. The first part of the formula (the part before the ampersand) returns the last digit of the year and the part after the ampersand subtracts the first day of the current year from the date being converted, and then adds 1 back to that date. The result is the ordinal day within the year.
If the day-of-the-year portion of the Julian date must always be three digits, then you need to modify the formula just a bit more. As written above, the formula will return 1, 2, or 3 digits for the last part of the formula. If it always needs to be 3, then use this, instead:
=RIGHT(YEAR(A1),2)&RIGHT("000"&(A1-DATE(YEAR(A1),1,1)+1),3)
If you prefer to have the formula return a number rather than a text string, you could enclose the entire formula within a VALUE function, or you could simply multiply the year digit by 1000 in the formula. Both approaches are shown here:
=VALUE(RIGHT(YEAR(A1),2)&RIGHT("000"&(A1-DATE(YEAR(A1),1,1)+1),3)) =RIGHT(YEAR(A1),1)*1000+(A1-DATE(YEAR(A1),1,1)+1)
You can also find information on working with Julian dates in Microsoft Office Support:
https://support.office.com/en-us/article/Insert-Julian-dates-Functions-0c7fa6aa-daff-402e-9990-93a5b76ba018
There is also additional information available on Chip Pearson's Web site:
http://www.cpearson.com/excel/jdates.htm
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9150) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Unique Military Date Format.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!
Sometimes the format in which you receive data is not the same format that would be optimal for Excel. For instance, you ...
Discover MoreWhen you load data into Excel that was created in other programs, the formatting used for some types of data (such as ...
Discover MoreWant to find out how many of a particular weekday occurs within a given month? Here's how you can find the desired ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2025-08-20 06:22:45
jamies
That format was used on computer systems )
the filling a room on their own ones
well before the appearance of "PC" - type devices
and generally available spreadsheet Apps.
hence the massive impact of the Y2K arrival.
and then there are the additional variations with extra leading digit for the centuries since 1900, so confusingly 100 would indicate the year starting 2000
and then 4 digits for the year one,
with astronomers having their own version!
so ,
just because you're told it's a julian date (representation) there are still things to check with whoever sent that - as excel will strip off a leading 0 from the centuries mode one and present one that looks like being in the current century - not the 1900's !
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments