К тексту на этой странице мог быть частично применён машинный перевод.

Функция Index (Индекс)

Returns a value from a range based on provided row and column indexes

Синтаксис

INDEX(range, row_index, [column_index])
  • диапазон
    The group of cells that you want to evaluate
  • row_index
    The row position (used in a selected range with one column, such as a list) of the item to return
  • column_index—(необязательно)
    The column position (used in a selected range with two or more columns, such as a table) of the item to return

Пример использования

INDEX([Task Name]:[Task Name], 5
INDEX(CHILDREN([Task Name]@row), 1)

Примечания об использовании

  • The range can be a function that returns multiple values, for example: ANCESTORS, CHILDREN, or COLLECT.
  • You can use the MATCH function as the row_index value for INDEX to return an item from a range based on the relative position of a value in another range. (See the example below.)
  • You can use the COLLECT function as the range value for INDEX to return an item from a list of collected values that meet the specified criteria. (See the example below.)

Примеры

В примере ниже используется информация из этой таблицы.

 Предмет одеждыОбщая сумма операцииПродано единицЦена за ед.Есть в наличии?
1Футболка1 170,007815,00
Brandfolder Image
Checked checkbox.
2Брюки1 491,004235,50
Brandfolder Image
Unchecked checkbox.
3Куртка812,00217200,00
Brandfolder Image
Checked checkbox.

Вот несколько примеров использования функции DATE для данных из таблицы выше.

ФормулаОписаниеРезультат
=INDEX([Clothing Item]1:[Units Sold]3, 1, 3)Returns the value in row 1 of the Units Sold column 78
=INDEX(COLLECT([Transaction Total]1:[Transaction Total]3, [In Stock?]1:[In Stock?]3, true), 1)Collects the values in the Transaction Total column for rows where the check box in the In Stock? column is checked (true), and returns the first entry in that collection$1,170.00
=INDEX([Price Per Unit]1:[Price Per Unit]3, MATCH(“Jacket”, [Clothing Item]1:[Clothing Item]3, 0))Возвращает значение из столбца Предмет одежды, соответствующее строке с датой 12.02.2023 в столбце Дата продажи.$200
=INDEX([In Stock?]:[In Stock?], MATCH(“Jacket”, [Clothing Item]:[Clothing Item], 0))

Возвращает значение из столбца Предмет одежды, соответствующее строке с датой 12.02.2023 в столбце Дата продажи.

Since the In Stock? Column is a checkbox. The column where you type this formula must be a checkbox type, too. 

Brandfolder Image
Checked checkbox.

Ensure the type of data you will get from the INDEX formula matches the column type where you are using the formula. This includes formatting such as currency or percentages if you wish to see the data displayed in that format. 


Остались вопросы?

If you have an Enterprise plan, you can use AI to help write and troubleshoot formulas.

Используйте шаблон Руководство по работе с формулами, чтобы просмотреть дополнительные ресурсы и изучить более 100 формул. Руководство содержит глоссарий, описывающий каждую функцию, обращение с которой вы сможете отработать на практике, и примеры как часто используемых, так и более сложных функций.

Изучить примеры того, как эту функцию применяют другие пользователи Smartsheet, или задать интересующий вопрос можно в Сообществе Smartsheet.

Обратиться к Сообществу