Returns the year from a date as a four-digit number
Sample Usage
YEAR([Due Date]5)
Syntax
YEAR(
-
date
-
date—你想重新的日期turn the year.
Examples
This example references the following sheet information:
Clothing Item | Transaction Total | Units Sold | 销售日期 | |
---|---|---|---|---|
1 | T-Shirt | 1,170.00 | 78 | 02/12/19 |
2 | Pants | 1,491.00 | 42 | 02/15/19 |
3 | Jacket | 812.00 | 217 | 02/20/19 |
Given the table above, here are some examples of using YEAR in a sheet:
Formula | Description | Result |
---|---|---|
=YEAR([Sold Date]1) | Produces the year for row 1 of the销售日期column | 2019 |
=SUMIF([Sold Date]:[Sold Date], YEAR(@cell) = YEAR(TODAY()), [Units Sold]:[Units Sold]) | Sums the total amount ofUnits Soldfor the current year. (In this example, the year is 2019.) Rows 1, 2, and 3 apply. | 337 |
=SUMIF([Sold Date]:[Sold Date], YEAR(@cell)=YEAR(TODAY()), [Transaction Total]:[Transaction Total]) | Sums the total amount ofTransaction Totalfor the current year. (In this example, the year is 2019.) Rows 1,2, and 3 apply. | 3,473 |
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.