Синтаксис
MATCH(search_value, range, [search_type])
- search_value—The value to search for.
- диапазон—The cell range (lookup table) to be searched.
- search_type—(необязательно)The default is 1. The manner in which to search, depending on whether the range is sorted ascending (1), not sorted (0), or sorted descending (-1).
Пример использования
MATCH("Task A"; [Task Name]1:Done5)
Примечания об использовании
Smartsheet calculates the relative position of a search value by counting cells from left to right (across columns), then top to bottom (across rows). In a lookup table consisting of two columns, the cell in the top row of the leftmost column is the first position, 1.
For the optional search_type argument:
- 1: (The default value) Finds the largest value less than or equal to search_value (requires that the range be sorted in ascending order)
- 0: Finds the first exact match (the range may be unordered)
- -1: Finds the smallest value greater than or equal to search_value (requires that the range be sorted in descending order)
Примеры
В примере ниже используется информация из этой таблицы.
Номер строки | Предмет одежды | Общая сумма операции | Продано единиц | Цена за ед. | Дата заказа |
---|---|---|---|---|---|
1 | Футболка | $1,170.00 | 78 | 15,00 долл. США | 12.02.2019 |
2 | Брюки | $1,491.00 | 42 | 35,50 долл. США | 15.02.2019 |
3 | Куртка | $900.00 | 45 % | 20,00 | 20.02.2019 |
Вот несколько примеров использования функции DATE для данных из таблицы выше.
Формула | Описание | Результат |
---|---|---|
=MATCH("Pants", [Clothing Item]:[Clothing Item], 0) | Returns the row position for Pants in the Clothing Item column | 2 |
=MATCH(42, [Units Sold]1:[Price Per Unit]3, 0) | Returns the position of the numeric value 42 from the two-column table, where 78 would be 1st position and $20.00 is 6th position | 3 |
=MATCH(DATE(2019, 2, 12), [Order Date]:[Order Date]) | Returns the position of the date February 12, 2019, using the DATE function, in the Order Date column | 1 |
=INDEX([Price Per Unit]:[Price Per Unit], MATCH("Jacket", [Clothing Item]:[Clothing Item], 0)) | Возвращает значение из столбца Предмет одежды, соответствующее строке с датой 12.02.2023 в столбце Дата продажи. | 20,00 |
Остались вопросы?
Используйте шаблон Руководство по работе с формулами, чтобы просмотреть дополнительные ресурсы и изучить более 100 формул. Руководство содержит глоссарий, описывающий каждую функцию, обращение с которой вы сможете отработать на практике, и примеры как часто используемых, так и более сложных функций.
Сочетания формул для межтабличных ссылок
Изучить примеры того, как эту функцию применяют другие пользователи Smartsheet, или задать интересующий вопрос можно в Сообществе Smartsheet.