Funcións de texto

Esta sección contén descricións das funcións de Texto.

Para acceder a esta orde...

Inserir - Función, categoría Texto


Empregar aspas duplas nas fórmulas

Para incluír unha cadea de texto nunha fórmula coloque a cadea de texto entre dúas aspas duplas (") e o Calc toma os caracteres da cadea sen intentar interpretalos. Por exemplo, a fórmula ="Ola, mundo!" mostra a cadea de texto Ola, mundo! na cela sen aspas arredor.

A fórmula, algo máis complexa, =CONCATENAR("A vida é realmente sinxela, ";"mais insistimos en facela complicada";"(Confucio)." concatena tres cadeas individuais entre aspas duplas producindo A vida é realmente sinxela, mais insistimos en facela complicada (Confucio)."

Para colocar unhas aspas duplas literalmente dentro dunha cadea dunha fórmula pódense empregar dous métodos:

  1. Pódense «escapar» as aspas duplas cunhas adicionais, co que o Calc trata as aspas duplas escapadas como un valor literal. Por exemplo, a fórmula ="Chámome ""Xan Ribeiro"". produce a saída Chámome "Xan Ribeiro". Outro exemplo sinxelo é a fórmula =UNICODE(""""), que devolve 34; o valor decimal do carácter de aspa dupla en Unicode (U+0022). Aquí, as aspas primeira e cuarta indican o comezo e o fin da cadea, mentres que a segunda escapa a terceira.

  2. Pódense empregar as funcións CHAR ou UNICHAR para inserir aspas duplas. Por exemplo, a fórmula =UNICHAR(34) & "Cousos do lobo" & UNICHAR(34) & " é un poema de Uxío Novoneyra." mostra a cadea "Cousos do lobo" é un poema de Uxío Novoneyra.

Teña en conta que a función de corrección automática do Calc pode modificar as aspas duplas. A corrección automática non debería cambiar as aspas duplas dentro dunha cela con fórmula, mais pode cambiar as que aparecen en celas que non son de fórmula e conteñen texto. Por exemplo, se copia unha cadea rodeada por unha forma distinta de aspas, tal como as aspas duplas á esquerda (U+201C) e as aspas duplas á dereita (U+201D) e a copia nunha cela con fórmula, pode producirse un erro. Abra a área Aspas duplas da caixa de diálogo Ferramentas - Opcións de corrección automática - Opcións rexionais para indicar que caracteres se han de empregar para corrixir automaticamente as aspas duplas tipográficas inicial e final. Desmarque o botón de alternancia Substituír para desactivar esta funcionalidade.

Texto baleiro e celas en branco

As celas co texto baleiro ("") non equivalen a celas en branco. Ao buscar ou calcular con texto, a cadea baleira "" é o texto de lonxitude cero.

Por exemplo, cando a fórmula en A1 devolve a cadea baleira "", aplícase o seguinte:

=ENBRANCO(A1) devolve FALSO. A cela non está baleira.

=ÉFÓRMULA(A1) devolve VERDADEIRO. A cela é unha fórmula.

=ÉLÓXICO(A1) devolve FALSO. Non é un valor lóxico.

=ÉNONTEXTO(A1) devolve FALSTO. A cela ten texto baleiro (unha cadea en branco).

=ÉNÚMERO(A1) devolve FALSO. Non é un número.

=ÉTEXTO(A1) devolve VERDADEIRO. A cela ten a cadea baleira (texto en branco), calculada por unha fórmula.

=LONX(A1) devolve 0. A lonxitude, ou tamaño, da cadea baleira é 0.

ARABIC

Returns the numeric value corresponding to a Roman number expressed as text.

ASC

Converts double-byte (full-width) characters to single-byte (half-width) ASCII and katakana characters.

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

Converte un número nunha cadea que representa a cantidade no formato de moeda, arredondado ao número especificado de decimais, empregando o separador de decimais que corresponde á configuración local actual. No campo Valor introduza o número que hai que converter. Opcionalmente, pódese introducir o número de decimais no campo Decimais. Se non se especifica ningún valor todos os números en formato de moeda móstranse con dous decimais.

EXACT

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

PROCURAR

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

Converts single-byte (half-width) ASCII or katakana characters to double-byte (full-width) characters.

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.

REGEX

Matches and extracts or optionally replaces text using regular expressions.

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).

ROMAN

Converts a number into a Roman numeral. The value range must be between 0 and 3999. A simplification mode can be specified in the range from 0 to 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.

VALUE

Converts the string representation of a number to numeric form. If the supplied string is a valid date, time, or date-time, the corresponding date-time serial number is returned.

WEBSERVICE

Get some web content from a URI.

FILTERXML

Apply a XPath expression to a XML document.

ENCODEURL

Returns a URL-encoded string.

Precisamos da súa axuda!