Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
DayOfYear Function?
Is there anyway to return the day number of the year. For example, where
12/26/2003 would be = to 300. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions | |||
Excel should support DAYOFYEAR(year,month,day) returns julian dat. | Excel Worksheet Functions | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |