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

Функция LEN

Returns the number of characters in a text string, including spaces

Синтаксис

LEN(text)
  • Текст
    The string whose length you want returned

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

Hello, world!

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

  • The LEN function doesn’t count formatting values (including currency formatting).

  • Dates typically have a length of 8 values; however, if the date column has dependencies, it has a length of 16 values.

Примеры

Use =LEN(column@row) as the base of your LEN functions.

To ensure you have the correct syntax for the column name, type =LEN( and then select the column you want to use.

Example 1 - Identify the length of comment values

=IF(LEN(Comments@row)>30, 1, 0)

This LEN formula calculates the number of characters in the text of the Comments Primary column for the row for the formula. Use this option to filter for detailed comments or rows with no comments.

Example 2 - Add leading 0’s (zeroes) and standardize the length of an ID value always to be at least three digits long

=IF(LEN([ID Value]@row)=2, “0”+[ID Value]@row, IF(LEN([ID Value]@row)=1, “00”+[ID Value]@row), [ID Value]@row)

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

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

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

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