Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Unique Military Date Format.
by Allen Wyatt
(last updated September 6, 2014)
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 2010 would end up as 10190. This shows the year (10, which is for 2010) 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:
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:
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:
You can also find information on working with Julian dates in Microsoft's Knowledge Base:
This article indicates it is for Excel 2000, but the formulas it presents work well in other versions of Excel as well. There is also additional information available on Chip Pearson's Web site:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9150) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Unique Military Date Format.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
Want to push a date to some pre-defined day of the month? Here are some ways to force the issue.Discover More
If your company closes out its accounting months at the end of each calendar quarter, figuring out the proper closing ...Discover More
Need to figure out if a given year is a leap year? It's not as easy as you think! This tip provides a plethora of ways ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.