Explanation

The DATE function builds dates from separate year, month, and day values. One of its tricks is the ability to roll forward to correct dates when given days and months that are “out of range”. For example, DATE returns April 9, 2016, with the following arguments:

=DATE(2016,1,100)

There is no 100th day in January, so DATE simply moves forward 100 days from January 1 and returns the correct date.

The formula on this page takes advantage of this behavior. The year is assumed to be 2015 in this case, so 2015 is hard-coded for the year, and 1 is used for the month. The day value comes from column B, and the DATE function calculates the date as explained above.

Extracting a year value from a Julian date

If you have a date in a Julian format, for example, 10015, where the format is “dddyy”, you can adapt the formula as follows:

=DATE(RIGHT(A1,2),1,LEFT(A1,3))

Here, we use RIGHT to extract the 2 characters from the right for the year , and LEFT to extract 3 characters from the left for the day . The month is supplied as 1, as in the first example.

Explanation

The DAY function takes just one argument, the date from which you want to extract the day. In the example, the formula is:

=DAY(B5)

B5 contains a date value for January 5, 2016. The DAY function returns the number 5 representing the day component of the date.

Note that you can use DAY to extract the day from a day entered as text:

=DAY("1/5/2016")

But this can produce unpredictable results on computers using different regional date settings. In general it’s better (and more flexible) to supply an address to a cell that already contains a valid date value as the argument for DAY.