![]() |
DayOfYear Function?
Is there anyway to return the day number of the year. For example, where
12/26/2003 would be = to 300. |
DayOfYear Function?
If you try with 1 in a cell and then format that cell to date, then you will
get day number 1. Count the number of days from that day until the day from which you want to start and subtract that number from int(now()). Ole "Joe" wrote in message ... Is there anyway to return the day number of the year. For example, where 12/26/2003 would be = to 300. |
DayOfYear Function?
Joe,
This should work, say your date was in A1 =DATEDIF("2003/1/1",A1,"D") + 1 Dan E "Joe" wrote in message ... Is there anyway to return the day number of the year. For example, where 12/26/2003 would be = to 300. |
DayOfYear Function?
Joe wrote:
Is there anyway to return the day number of the year. For example, where 12/26/2003 would be = to 300. With a simple formula, you could do something like this, assuming 12/26/2003 was in A1: =A1-DATE(YEAR(A1),1,1)+1 -- Dianne |
DayOfYear Function?
Hi Joe,
This function should do that: =A1-DATE(YEAR(A1),1,1)+1 -- Regards, Jake Marx MS MVP - Excel Joe wrote: Is there anyway to return the day number of the year. For example, where 12/26/2003 would be = to 300. |
DayOfYear Function?
Worksheet solution in response to your .misc query.
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Joe" wrote in message ... Is there anyway to return the day number of the year. For example, where 12/26/2003 would be = to 300. |
DayOfYear Function?
If it's a programming solution you need, two possibilities could be:
Function DayOfYear(dte As Date) As Long DayOfYear = dte - DateSerial(Year(dte), 1, 0) ' or... DayOfYear = Format(dte, "y") End Function The second idea appears to be a "hair" faster, besides shorter. -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "Dianne" wrote in message ... Joe wrote: Is there anyway to return the day number of the year. For example, where 12/26/2003 would be = to 300. With a simple formula, you could do something like this, assuming 12/26/2003 was in A1: =A1-DATE(YEAR(A1),1,1)+1 -- Dianne |
All times are GMT +1. The time now is 12:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com