Julian Date Conversion

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
 
N

Norman Harker

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top