-
search_range
-
criterion
-
search_range—The cell or cell range to search within
-
criterion—The value you want to find
- The HAS function is designed to work with multi-select dropdown and multi-contact columns. It won’t cause an error if used with other column types, but it will only return true if the criterion exactly matches the contents of the cell or a distinct value within a multi-select or multi-contact cell.
In the example above, if [Day of Week]1 is in a Text/Number column, HAS will return “true” if [Day of Week]1 = “Monday” but will return “false” if [Day of Week]1 = “Monday Tuesday.” If [Day of Week]1 is in a multi-select column, HAS will return “true” if [Day of Week]1 = “Monday” and will also return true if [Day of Week]1 contains values of “Monday” and “Tuesday”. It will return “false” if the value in [Day of Week]1 = “Monday Tuesday”. - The HAS function is distinct from CONTAINS because it searches for specific values where CONTAINS searches for strings or characters containing the criteria.
For example, using HAS to search for “apples” will only return true if “apples” is by itself in a text/number column or is a distinct value within a multi-select column. Using CONTAINS to search for “apples”, on the other hand, will return true if it finds “apples” in any part of a text/number cell, or within any distinct value inside a multi-select cell.
Here are some examples of using HAS in a sheet.
Formula |
Description |
Result |
---|---|---|
=SUMIF([Clothing Item]:[Clothing Item], HAS(@cell, "T-Shirt"), [Units Sold]:[Units Sold]) |
Sums the cell values in theUnits Soldcolumn if the adjacent cell in theClothing Itemcolumn of the same row has the exact matching value ofT-Shirt Row 1 meets these criteria. |
78 |
=COUNTIFS([Sold Date]:[Sold Date], HAS(@cell, "1:55 PM")) |
Counts the cell values in the销售日期column that has the exact matching value of value02/15/19 1:55 PM Row 2 meets the criteria. |
1 |
=IF(HAS([Clothing Item]:[Clothing Item], "Jacket"), "True", "False") |
If theClothing Itemcolumn has the exact matching value ofJacket,the formula produces the valueTrue. Row 3 meets these criteria. |
True |
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.