Master Work
asked on
If I have the year and the number of days in that year, how can I know the date?
If I have the year and the number of days in that year, how can I know the date?
ASKER
I don't have the month. I have the number of days from the start of the year.
into a cell. then have a cell = 1/1/yy + (days-1)
this will be the date for that number of days in year yy.
if you have
this will be the date for that number of days in year yy.
if you have
year = 2018
daynumber = 20
stryear= "01-Jan-" + year.tostring()
DateAdd("d", daynumber, stryear)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you so much
you don't need the month we hardcode the month as 1 then add days to that.
Use the DateSerial function as it always return a valid date.
If parameters are out of "traditional" values, the result will be adjusted.
Sample code:
Open in new window