Funções de texto

Essa seção contém descrições das funções de Texto.

Para acessar este comando...

Inserir - Função - Categoria Texto


Utilizar aspas duplas em fórmulas

Para incluir um texto numa fórmula, coloque o texto entre aspas duplas (") e o Calc irá interpretá-los. Por exemplo, a fórmula "Olá mundo!" exibe o texto Olá mundo! na célula, sem aspas duplas ao redor.

A fórmula mais complexa =CONCATENAR ("A vida é realmente simples, "; "mas insistimos em torná-la complicada "; "(Confúcio).") concatena três textos individuais entre aspas duplas, gerando A vida é muito simples, mas insistimos em torná-la complicada (Confúcio).

Para colocar aspas duplas literalmente num texto dentro de uma fórmula, dois métodos podem ser usados:

  1. Você pode "escapar" as aspas duplas com aspas duplas adicionais, e o Calc trata as aspas duplas de escape como um valor literal. Por exemplo, a fórmula ="Meu nome é ""João""." retorna o texto Meu nome é "João". Outro exemplo simples é a fórmula =UNICODE ("""") que retorna 34 , o valor decimal do caractere de aspas Unicode (U+0022) - aqui a primeira e a quarta aspas duplas indicam o início e fim do texto, enquanto a segunda aspa dupla escapa da terceira.

  2. Você pode usar a função CARACT ou a função CARACT.UNICODE para inserir aspas duplas. Por exemplo, a fórmula =CARACT.UNICODE(34) & "Gabriela, Cravo e Canela" & CARACT.UNICODE(34) & "é um livro famoso de Jorge Amado." exibe o texto "Gabriela, Cravo e Canela" é um livro famoso de Jorge Amado.

Tenha em conta que a função de Autocorreção do Calc pode modificar aspas duplas. A Autocorreção não deve alterar as aspas duplas nas células de fórmula, mas pode alterar aquelas usadas em células que não são de fórmula que contêm texto. Por exemplo, se copiar uma string envolta por alguma outra forma de aspas duplas tipográficas, como as aspas duplas à esquerda (U+201C) e as aspas duplas à direita (U+201D), e depois colar em um célula de fórmula, pode ocorrer um erro. Abra a área Aspas duplas da caixa de diálogo Ferramentas - Opções de Autocorreção - Opções do local para definir os caracteres usados para corrigir automaticamente as aspas duplas tipográficas iniciais e finais. Desmarque o botão de alternância Substituir para desativar o recurso.

Texto vazio e células em branco

Células com texto vazio ("") não são equivalentes a células em branco. Ao pesquisar ou calcular com texto, o texto vazio "" é o texto com comprimento zero.

Por exemplo, quando a fórmula em A1 retorna o texto vazio "", o seguinte se aplica:

=ÉCÉL.VAZIA(A1) retorna FALSO. A célula não está vazia.

=ÉFÓRMULA(A1) retorna VERDADEIRO. A célula contém uma fórmula.

=ÉLÓGICO(A1) retorna FALSO. Não é um valor lógico.

=É.NÃO.TEXTO(A1) retorna FALSO. A célula contém um texto vazio.

=ÉNUM(A1) retorna FALSO. Não é um número.

=ÉTEXTO(A1) retorna VERDADEIRO. A célula tem um texto vazio, calculado por uma fórmula.

=NÚM.CARACT(A1) retorna 0. O tamanho to texto vazio é 0.

ÁRABE

Retorna o valor numérico correspondente a um número romano expresso como texto.

ASC

Converte caracteres de duplo byte (largura inteira) para caracteres ASCII de byte único (meia largura) e caracteres katakana.

BAHTTEXT

Converts a number to Thai text, including the Thai currency names.

BASE

Converts a positive integer to a specified base into a text from the numbering system. The digits 0-9 and the letters A-Z are used.

CHAR

Converts a number into a character according to the current code table. The number can be a two-digit or three-digit integer number.

CLEAN

All non-printing characters are removed from the string.

CODE

Returns a numeric code for the first character in a text string.

CONCATENATE

Combines several text strings into one string.

DECIMAL

Converts text that represents a number in a numeral system with the given base radix to a positive integer. The radix must be in the range 2 to 36. Spaces and tabs are ignored. The Text field is not case-sensitive.

DOLLAR

Converts a number to a string representing the amount in the currency format, rounded to a specified decimal places, using the decimal separator that corresponds to the current locale setting. In the Value field enter the number to be converted. Optionally, you may enter the number of decimal places in the Decimals field. If no value is specified, all numbers in currency format will be displayed with two decimal places.

EXACT

Compares two text strings and returns TRUE if they are identical. This function is case-sensitive.

FIND

Returns the position of a string of text within another string.You can also define where to begin the search. The search term can be a number or any string of characters. The search is case-sensitive.

FIXED

Returns a number as text with a specified number of decimal places and optional thousands separators.

JIS

Converte caracteres ASCII ou katakana de byte único (meia largura) em caracteres de byte duplo (largura total).

LEFT

Returns the first character or characters of a text.

LEFTB

Returns the first characters of a DBCS text.

LEN

Returns the length of a string including spaces.

LENB

For double-byte character set (DBCS) languages, returns the number of bytes used to represent the characters in a text string.

LOWER

Converts all uppercase letters in a text string to lowercase.

MID

Returns a text string of a text. The parameters specify the starting position and the number of characters.

MIDB

Returns a text string of a DBCS text. The parameters specify the starting position and the number of characters.

PROPER

Capitalizes the first letter in all words of a text string.

EXPREG

Corresponde e extrai ou, opcionalmente, substitui o texto usando expressões regulares.

REPLACE

Replaces part of a text string with a different text string. This function can be used to replace both characters and numbers (which are automatically converted to text). The result of the function is always displayed as text. If you intend to perform further calculations with a number which has been replaced by text, you will need to convert it back to a number using the VALUE function.

REPT

Repeats a character string by the given number of copies.

RIGHT

Returns the last character or characters of a text.

RIGHTB

Returns the last character or characters of a text with double bytes characters sets (DBCS).

ROMANO

Converte um número em um numeral romano. O intervalo de valores deve estar entre 0 e 3999. Um modo de simplificação pode ser especificado no intervalo de 0 a 4.

SEARCH

Returns the position of a text segment within a character string. You can set the start of the search as an option. The search text can be a number or any sequence of characters. The search is not case-sensitive. If the text is not found, returns error 519 (#VALUE).

SUBSTITUTE

Substitutes new text for old text in a string.

T

This function returns the target text, or a blank text string if the target is not text.

TEXT

Converts a value into text according to a given format.

TRIM

Removes spaces from a string, leaving only a single space character between words.

UNICHAR

Converts a code number into a Unicode character or letter.

UNICODE

Returns the numeric code for the first Unicode character in a text string.

UPPER

Converts the string specified in the text field to uppercase.

VALOR

Converte a representação em texto de um número para sua forma numérica. Se o texto fornecido for uma data, hora ou data-hora válida, retorna o número de série da data-hora correspondente é.

SERVIÇOWEB

Obtém o conteúdo internet de um endereço URI.

FILTROXML

Aplica uma expressão XPath a um documento XML

CODIFURL

Retorna uma cadeia de caracteres com codificação de URL.