返回一个数字代表一年的那一天,1–365, where 1 is the first day of the year
Sample Usage
YEARDAY([Due Date]5)
Syntax
YEARDAY(
-
date
-
date—The date from which you want to return the day as a number
Usage Notes
For leap years, YEARDAY returns a number between 1–366.
Examples
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:
Formula | Description | Result |
---|---|---|
=YEARDAY([Ship Date]1) | Returns the number of days in to the year for the date from row 1 of theShip Datecolumn | 46 |
=IF(YEARDAY([Ship Date]2) < 182, "First Half of Year", "Second Half of Year") | Returns the stringFirst Half of Yearif the number of days in to the year for the date from row 2 of theShip Datecolumn is less than 182. Otherwise, the function returnsSecond 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 theUnits Soldcolumn by the number of days in to the year for row 2 of theShip Datecolumn, returns the rounded result, and adds the stringAvg 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 theFormula Handbook templateto 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.