I've been using the below formula to extract the day of the year numerically (between 1 and 366 [leap years included]) however cannot get the function to perform for dates prior to 1/1/1900. For example how can I get an output of "32" for the date 1/02/1889? Any ideas?

Here's the formula that works for post 1900: "day of the year"=C1+1-DATE(YEAR(C1),1,1)

I'm also trying to find a formula that will extract the week of the year for the same dataset. I'm currently using "week of the year"=(TRUNC(D1/7))+1 however this returns a 6 day week for the first week of each year. Any ideas would be great!