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