Julian Date Conversion

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I need a function to convert a standard date to a Julian
date. I tried the formula from the Knowledge Base but
couldn't get it to work.

Dave
 
Hi Dave!

I'll assume that your definition of Julian date is the day number of
the year. For this:

=A1-DATE(YEAR(A1),1,0)

Where A1 is =TODAY() [6-Apr-2004)
Returns: 97
[Note that the 0th of a Month is treated as the last day of the
preceding month.]

If this is a common requirement you can use the following User Defined
Function:

Function DAYINYEAR(DateForNumber As Date) As Integer
DAYINYEAR = DateForNumber - DateSerial(Year(DateForNumber), 1, 0)
End Function

But if you are referring to the correct definition of Julian Date use:

=IF(MOD(A1,1)<0.5,A1+2415018,A1+2415019)
This will return correctly using the 1900 date system for all dates
from 1-Mar-1900.

Julian Dates start at 12:00 Noon and are number of days from
1-Jan-4173 BCE (Julian Calendar)


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Back
Top