Returns a number representing the day in the year, 1–365, where 1 is the first day of the year
- date—The date from which you want to return the day as a number
For leap years, YEARDAY returns a number between 1–366.
This example references the following sheet information:
|Clothing Item||Units Sold||Sold Date||Order Date||Ship Date|
|1||T-Shirt||78||02/12/19 1:55 PM||02/12/19||02/15/19|
|2||Pants||42||02/15/19 10:23 AM||02/15/19||03/20/19|
|3||Jacket||217||02/20/19 2:45 PM||02/20/19||02/27/19|
Given the table above, here are some examples of using YEARDAY in a sheet:
|=YEARDAY([Ship Date]1)||Returns the number of days in to the year for the date from row 1 of the Ship Date column||46|
|=IF(YEARDAY([Ship Date]2) < 182, "First Half of Year", "Second Half of Year")||Returns the string First Half of Year if the number of days in to the year for the date from row 2 of the Ship Date column is less than 182. Otherwise, the function returns Second Half of Year.||First Half of Year|
|=ROUND([Units Sold]3 / YEARDAY([Order Date]3), 2) + “Avg jackets units sold each day”||Divides the value in row 3 of the Units Sold column by the number of days in to the year for row 2 of the Ship Date column, returns the rounded result, and adds the string Avg Jacket units sold each day (with a space and period) to the end||4.25 Avg Jacket units sold each day.|
Still need help?
Use the Formula Handbook template to find more support resources, and view 100+ formulas, including a glossary of every function that you can practice working with in real time, and examples of commonly used and advanced formulas.
Find examples of how other Smartsheet customers use this function or ask about your specific use case in the Smartsheet online Community.