How do I create a day of year function ? how many days since the first of the year like DOY() ? - Answers - Salesforce Trailblazer Community
Ask Search:
Bob LeeBob Lee 

How do I create a day of year function ? how many days since the first of the year like DOY() ?

I am trying to formula create a field on a custom object which saves how many days since the first of the year.   like a DOY() type functional field.  
Thank you
 
Best Answer chosen by Bob Lee
Tony TrinhTony Trinh
Sorry, it would be +1 because Jan 1 will be 0 if you use that formula above:
TODAY() - DATE(YEAR(TODAY()),1,1) + 1
Use this instead.

All Answers

Rabin BRabin B
Tony TrinhTony Trinh
Hello Bob,

Try this out:
TODAY() - DATE(YEAR(TODAY()),1,1)
Tony TrinhTony Trinh
Sorry, it would be +1 because Jan 1 will be 0 if you use that formula above:
TODAY() - DATE(YEAR(TODAY()),1,1) + 1
Use this instead.
This was selected as the best answer
Bob LeeBob Lee
Thank you !  perfect. worked exactly for what I needed. 
Bob Lee