Syntax
MONTH(date)
- date—The date from which you want to return the month
Sample usage
MONTH([Due Date]5)
Examples
This example references the following sheet information:
Row # | Sold Date | Transaction Total | Item Number | Clothing Item |
---|---|---|---|---|
Row # 1 | Sold Date 02/12/19 | Transaction Total $1,170.00 | Item Number C001 | Clothing Item T-Shirt |
Row # 2 | Sold Date 02/15/19 | Transaction Total $1,491.00 | Item Number C002 | Clothing Item Pants |
Row # 3 | Sold Date 02/20/19 | Transaction Total $812.00 | Item Number C003 | Clothing Item Jacket |
Row # 4 *Leave blank | Sold Date | Transaction Total | Item Number | Clothing Item |
Given the table above, here are some examples of using a MONTH() function in a sheet:
Formula | Description | Result |
---|---|---|
Formula =MONTH([Sold Date]1) | Description Returns the representing month number for row 1 in the Sold Date column (February) | Result 2 |
Formula =SUMIF([Sold Date]1:[Sold Date]3, MONTH(@cell) = 2, [Transaction Total]1:[Transaction Total]3) | Description Sums the values in the Transaction Total column if the value in the Sold Date column return a month value equal to 2. Rows 1, 2, and 3 meet the criteria. | Result $3473 |
Formula =COUNTIF([Sold Date]:[Sold Date], MONTH(@cell) = 2) | Description When the MONTH function contains a blank cell within the range of dates it is reviewing, it will produce the #INVALID DATA TYPE error. This is expected behavior. To resolve this, you’ll want to utilize an IFERROR function. | Result #INVALID DATA TYPE |
Formula =COUNTIF([Sold Date]:[Sold Date], IFERROR(MONTH(@cell), 0) = 2) | Description By wrapping the MONTH function in an IFERROR function, the function will no longer produce an error. This formula counts the number of values in the Sold Date column that are equal to 2 (February). | Result 3 |
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.
You can find examples of how other Smartsheet customers use this function or ask about your specific use case in the Smartsheet online Community.