Syntax
CONTAINS(search_for; range)
- search_for—The text or a cell reference to find
- range—The group of cells to evaluate
Sample usage
IF(CONTAINS("Jacket", [Clothing Item]:[Clothing Item]), "True", "False")
Examples
This example references the following sheet information:
Row # | Clothing Item | Units Sold | Sold Date | Status |
---|---|---|---|---|
Row # 1 | Clothing Item T-Shirt | Units Sold 78 | Sold Date 02/12/19 10:23 PM | Status Green |
Row # 2 | Clothing Item Pants | Units Sold 42 | Sold Date 02/15/19 1:55 AM | Status Red |
Row # 3 | Clothing Item Jacket | Units Sold 217 | Sold Date 02/20/19 2:45 PM | Status Yellow |
Given the table above, here are some examples of using CONTAINS in a sheet:
Formula | Description | Result |
---|---|---|
Formula =SUMIF([Clothing Item]:[Clothing Item], CONTAINS("T-Shirt", @cell), [Units Sold]:[Units Sold]) | Description Sums the cell values in the Units Sold column if the adjacent cell in the Clothing Item column of the same row contains the value T-Shirt. Row 1 meets this criteria. | Result 78 |
Formula =COUNTIFS([Sold Date]:[Sold Date], CONTAINS("1:55 AM", @cell)) | Description Counts the cell values in the Sold Date column that contains the value 1:55 AM. Row 2 meets the criteria. | Result 1 |
Formula =IF(CONTAINS("Jacket", [Clothing Item]:[Clothing Item]), "True", "False") | Description If the value Jacket is contained within a cell of the Clothing Item column produce the value True. Row 3 meets this criteria. | Result True |
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.