ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   convert date to yyyyddd format (https://www.excelbanter.com/excel-worksheet-functions/158240-convert-date-yyyyddd-format.html)

Bruce

convert date to yyyyddd format
 
Hi,

How can I format a date into the fomat yyyyddd where ddd is the day of the
calender year (i.e. out of 365 or 366 if a leap year. Assume my date is in
cell A2.

Bruce

Dave Peterson

convert date to yyyyddd format
 
=YEAR(A2)*1000+A2-DATE(YEAR(A2),1,0)
or
=YEAR(A2)&TEXT(A2-DATE(YEAR(A2),1,0),"000")
(if you want text)


Bruce wrote:

Hi,

How can I format a date into the fomat yyyyddd where ddd is the day of the
calender year (i.e. out of 365 or 366 if a leap year. Assume my date is in
cell A2.

Bruce


--

Dave Peterson

Teethless mama

convert date to yyyyddd format
 
=YEAR(A2)&A2-DATE(YEAR(A2),1,)


"Bruce" wrote:

Hi,

How can I format a date into the fomat yyyyddd where ddd is the day of the
calender year (i.e. out of 365 or 366 if a leap year. Assume my date is in
cell A2.

Bruce



All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com