Is there a function that returns the day 'number'?


Posted by BenH on December 04, 2000 2:59 AM

I want to be able to return an index number for a specified date in the year:
eg Jan 30 will be the 30th day; Dec 30th will be the 364th day (except for leap years!!).
Is there an in-built function that does this??

Yuk, I just drank the coffee grinds:(

Posted by Feargal Tierney on December 04, 2000 4:20 AM

Not a very easy way, but they DAY(A1) functio will tell you the day of the month.
The MONTH(cell ref) will return the month of the year, if you than had a function (using an array or the like) which could add all the days in the months to date, to this month, and then add the days in 'this' month to that total that should give you the number that this day is from Jan 1st.

Does this help any?

Furg

Posted by JAF on December 04, 2000 4:22 AM

Can't think of a specific function, but you can use the formula =A1-DATE(2000,1,1) where A1 contains your date and DATE(YYYY,M,D) represents the date you want to start counting from.


JAF



Posted by BenH on December 04, 2000 5:40 AM

Thanks guys, I appreciate the suggestions. The reason I was looking for it was so that I can chart year-on-year data. (There's still the problem of the leap year. I think I'll just delete Feb 29 if it's there!!)
Ben