Text Functions

This section contains descriptions of the Text functions.

이 명령을 사용하려면...

삽입 - 함수 - 범주 텍스트


Using double quotation marks in formulas

To include a text string in a formula, place the text string between two double quotation marks (") and Calc takes the characters in the string without attempting to interpret them. For example, the formula ="Hello world!" displays the text string Hello world! in the cell, with no surrounding double quotation marks.

The more complex formula =CONCATENATE("Life is really simple, "; "but we insist on making it complicated "; "(Confucius).") concatenates three individual strings in double quotation marks, outputting Life is really simple, but we insist on making it complicated (Confucius).

To place a literal double quotation mark within a string inside a formula, two methods can be used:

  1. You can "escape" the double quotation mark with an additional double quotation mark, and Calc treats the escaped double quotation mark as a literal value. For example, the formula ="My name is ""John Doe""." outputs the string My name is "John Doe". Another simple example is the formula =UNICODE("""") which returns 34, the decimal value of the Unicode quotation mark character (U+0022) — here the first and fourth double quotation marks indicate the beginning and end of the string, while the second double quotation mark escapes the third.

  2. You can use the CHAR function or the UNICHAR function to insert a double quotation mark. For example, the formula =UNICHAR(34) & "The Catcher in the Rye" & UNICHAR(34) & " is a famous book by J. D. Salinger." displays the string "The Catcher in the Rye" is a famous book by J. D. Salinger.

Be aware that Calc's AutoCorrect function may modify double quotation marks. AutoCorrect should not change the double quotation marks within formula cells but may change those used in non-formula cells containing text. For example, if you copy a string that is surrounded by some other form of typographical double quotation marks, such as the left double quotation mark (U+201C) and the right double quotation mark (U+201D), and then paste into a formula cell, an error may result. Open the Double Quotes area of the Tools - AutoCorrect Options - Localized Options dialog to set the characters used to automatically correct the start and end typographical double quotation marks. Uncheck the Replace toggle button to disable the feature.

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.

JIS

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

REGEX

Matches and extracts or optionally replaces text using regular expressions.

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.

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.

BAHTTEXT

태국어 통화 이름을 포함하여 숫자를 태국어 텍스트로 변환합니다.

Syntax

BAHTTEXT(Number)

Number는 임의의 숫자입니다. "Baht"는 숫자의 정수 부분에 추가되고 "Satang"은 숫자의 소수 부분에 추가됩니다.

Example

=BAHTTEXT(12.65)는 "12 개의 Baht 와 60 개의 Satang" 의 뜻을 가진 타이 문자로 된 문자열을 반환합니다.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

COM.MICROSOFT.BAHTTEXT

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.

Syntax

BASE(Number; Radix [; MinimumLength])

Number는 변환할 양의 정수입니다.

Radix indicates the base of the numeral system. It may be any positive integer between 2 and 36.

최소길이는 생성할 수 있는 문자의 최소 길이를 결정합니다. 만약 텍스트가 지정된 최소 길이보다 짧으면 문자열의 왼쪽에 0이 추가됩니다.(선택 사항)

Example

=BASE(17;10;4)은 10진수 0017을 반환합니다.

=BASE(17;2)는 이진수 10001을 반환합니다.

=BASE(255;16;4)는 00FF 을 16진수로 반환합니다.

See also

DECIMAL

CHAR

현재 코드 테이블에 따라 숫자를 문자로 변환합니다. 숫자는 두 자리 또는 세 자리 정수가 될 수 있습니다.

127 보다 큰 코드의 사용 가능 여부는 사용하는 시스템의 문자 매핑(예를 들어 iso-8859-1, iso-8859-2, Windows-1252, Windows-1250)에 따라 달라집니다. 따라서 이는 일정하지 않습니다.

Syntax

CHAR(Number)

Number는 문자에 대응되는 코드값을 의미하는 1과 255 사이의 수입니다.

Example

=CHAR(100)은 문자 d 를 반환합니다.

="abc" & CHAR(10) & "def"는 문자열에 개행 문자를 삽입합니다.

CLEAN

인쇄할 수 없는 모든 문자가 문자열에서 제거됩니다.

Syntax

CLEAN("Text")

Text는 인쇄불가능한 모든 문자를 제거하기 위한 텍스트를 참조합니다.

Example

=LEN(CLEAN(CHAR(7) & "LibreOffice Calc" & CHAR(8))) returns 16, showing that the CLEAN function removes the non-printable Unicode U+0007 ("BEL") and U+0008 ("BS") characters at the beginning and end of the string argument. CLEAN does not remove spaces.

CODE

텍스트 문자열의 첫 문자에 대한 숫자 코드를 구합니다.

Syntax

CODE("Text")

Text는 첫 문자의 코드가 검색되는 텍스트입니다.

127 보다 큰 코드의 사용 가능 여부는 사용하는 시스템의 문자 매핑(예를 들어 iso-8859-1, iso-8859-2, Windows-1252, Windows-1250)에 따라 달라집니다. 따라서 이는 일정하지 않습니다.

Example

=CODE("Hieronymus")는 72를 반환하고, =CODE("hieroglyphic")는 104를 반환합니다.

note

여기에 사용된 코드는 ASCII 코드가 아니라 현재 코드 표의 코드입니다.


CONCATENATE

여러 텍스트 문자열을 하나의 문자열로 결합합니다.

Syntax

CONCATENATE(String 1 [; String 2 [; … [; String 255]]])

String 1[; String 2][; … ;[String 255]] are strings or references to cells containing strings.

Example

=CONCATENATE("안녕";"하세요 ";"김 ";"선생님")은 안녕하세요 김 선생님을 반환합니다.

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.

If the radix is 16, a leading x or X or 0x or 0X, and an appended h or H, are disregarded. If the radix is 2, an appended b or B is disregarded. Other characters that do not belong to the numeral system generate an error.

Syntax

DECIMAL("Text"; Radix)

Text is the text to be converted.

Radix indicates the base of the numeral system. It may be any positive integer between 2 and 36.

Example

=DECIMAL("17";10)은 17을 반환합니다.

=DECIMAL("FACE";16)는 64206을 값으로 반환합니다.

=DECIMAL("0101";2)는 5를 반환합니다.

See also

BASE

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.

시스템 설정에서 통화 형식을 설정합니다.

Syntax

DOLLAR(Value [; Decimals])

Number는 수, 수를 포함한 셀에 대한 참조, 수를 반환하는 수식 등입니다.

소수점 이하 자리수는 소수점 아래 자릿수입니다.

Example

=DOLLAR(255) returns $255.00 for the English (USA) locale and USD (dollar) currency; ¥255.00 for the Japanese locale and JPY (yen) currency; or 255,00 € for the German (Germany) locale and EUR (euro) currency.

=DOLLAR(367.456;2) returns $367.46.

EXACT

두 개의 텍스트 문자열을 비교하여 동일한 경우 TRUE를 돌려줍니다. 이 함수는 대/소문자를 구분합니다.

Syntax

EXACT("텍스트1"; "텍스트2")

Text1은 비교할 첫번째 텍스트를 참조합니다.

텍스트2는 비교할 두번째 텍스트입니다.

Example

=EXACT(" microsystems";" Microsystems")는 FALSE를 반환합니다.

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.

Syntax

FIND("FindText"; "Text" [; Position])

FindText는 찾은 텍스트을 참조합니다.

Text는 검색할 위치에 있는 텍스트입니다.

Position은 텍스트 내에서 검색을 시작할 위치입니다. (선택 사항)

Example

=FIND(76;998877665544)는 6을 반환합니다.

FIXED

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

Syntax

FIXED(Number; [Decimals = 2 [; NoThousandsSeparators = FALSE]])

Number is rounded to Decimals places (after the decimal separator) and the result formatted as text, using locale-specific settings.

Decimals (optional) refers to the number of decimal places to be displayed. If Decimals is negative, Number is rounded to ABS(Decimals) places to the left from the decimal point. If Decimals is a fraction, it is truncated actually ignoring what is the closest integer.

NoThousandsSeparators (optional) determines whether the thousands separator is used. If it is TRUE or non-zero, then group separators are omitted from the resulting string. If the parameter is equal to 0 or if it is missing altogether, the thousands separators of your current locale setting are displayed.

Example

=FIXED(1234567.89;3)은 1,234,567.890 을 텍스트 문자열로 반환합니다.

=FIXED(123456.789;;TRUE) returns 123456.79 as a text string.

=FIXED(12345.6789;-2) returns 12,300 as a text string.

=FIXED(12134567.89;-3;1) returns 12135000 as a text string.

=FIXED(12345.789;3/4) returns 12,346 as a text string.

=FIXED(12345.789;8/5) returns 12,345.8 as a text string.

LEFT

텍스트의 첫 번째 문자를 하나 이상 반환합니다.

Syntax

LEFT("Text" [; Number])

Text는 시작 부분의 단어가 결정된 텍스트입니다.

Number는 시작 텍스트의 문자 수를 지정합니다. 이 매개 변수가 지정되지 않을 경우 문자 하나를 반환합니다.(선택 사항)

Example

=LEFT("output";3)은 “out”을 값으로 반환합니다.

LEFTB

Returns the first characters of a DBCS text.

tip

This function is available since LibreOffice 4.2.


Syntax

LEFTB("Text" [; Number_bytes])

Text is the text where the initial partial words are to be determined.

Number_bytes (optional) specifies the number of characters you want LEFTB to extract, based on bytes. If this parameter is not defined, one character is returned.

Example

=LEFTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead).

=LEFTB("中国";2) returns "中" (2 bytes constitute one complete DBCS character).

=LEFTB("中国";3) returns "中 " (3 bytes constitute one DBCS character and a half; the last character returned is therefore a space character).

=LEFTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters).

=LEFTB("office";3) returns "off" (3 non-DBCS characters each consisting of 1 byte).

LEN

공백을 포함하는 문자열의 길이를 구합니다.

Syntax

LEN("Text")

Text은 길이가 지정된 텍스트입니다.

Example

=LEN("Good Afternoon")는 14를 반환합니다.

=LEN(12345.67)은 8을 반환합니다.

LENB

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

tip

This function is available since LibreOffice 4.2.


Syntax

LENB("Text")

Text은 길이가 지정된 텍스트입니다.

Example

LENB("中") returns 2 (1 DBCS character consisting of 2 bytes).

LENB("中国") returns 4 (2 DBCS characters each consisting of 2 bytes).

LENB("office") returns 6 (6 non-DBCS characters each consisting of 1 byte).

=LENB("Good Afternoon") returns 14.

=LENB(12345.67) returns 8.

LOWER

텍스트 문자열의 모든 대문자를 소문자로 변환합니다.

Syntax

LOWER("Text")

Text는 변환될 텍스트를 참고합니다.

Example

=LOWER("Sun")는 sun을 반환합니다.

MID

텍스트의 텍스트 문자열을 반환합니다. 이 매개 변수는 문자 수와 시작 위치를 지정합니다.

Syntax

MID("Text"; Start; Number)

Text는 추출할 문자들을 포함하고 있는 텍스트입니다.

Start는 추출할 텍스트의 첫 문자 위치입니다.

Number는 텍스트 일부의 문자수를 의미합니다.

Example

=MID("office";2;2)는 ff를 반환합니다.

MIDB

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

tip

This function is available since LibreOffice 4.2.


Syntax

MIDB("Text"; Start; Number_bytes)

Text는 추출할 문자들을 포함하고 있는 텍스트입니다.

Start is the position of the first character in the text to extract.

Number_bytes specifies the number of characters MIDB will return from text, in bytes.

Example

=MIDB("中国";1;0) returns "" (0 bytes is always an empty string).

=MIDB("中国";1;1) returns " " (1 byte is only half a DBCS character and therefore the result is a space character).

=MIDB("中国";1;2) returns "中" (2 bytes constitute one complete DBCS character).

=MIDB("中国";1;3) returns "中 " (3 bytes constitute one and a half DBCS character; the last byte results in a space character).

=MIDB("中国";1;4) returns "中国" (4 bytes constitute two complete DBCS characters).

=MIDB("中国";2;1) returns " " (byte position 2 is not at the beginning of a character in a DBCS string; 1 space character is returned).

=MIDB("中国";2;2) returns " " (byte position 2 points to the last half of the first character in the DBCS string; the 2 bytes asked for therefore constitutes the last half of the first character and the first half of the second character in the string; 2 space characters are therefore returned).

=MIDB("中国";2;3) returns " 国" (byte position 2 is not at the beginning of a character in a DBCS string; a space character is returned for byte position 2).

=MIDB("中国";3;1) returns " " (byte position 3 is at the beginning of a character in a DBCS string, but 1 byte is only half a DBCS character and a space character is therefore returned instead).

=MIDB("中国";3;2) returns "国" (byte position 3 is at the beginning of a character in a DBCS string, and 2 bytes constitute one DBCS character).

=MIDB("office";2;3) returns "ffi" (byte position 2 is at the beginning of a character in a non-DBCS string, and 3 bytes of a non-DBCS string constitute 3 characters).

PROPER

텍스트 문자열의 모든 단어에서 첫 글자를 대문자로 바꿉니다.

Syntax

PROPER("Text")

Text는 변환될 텍스트를 참고합니다.

Example

=PROPER("the document foundation") returns The Document Foundation.

REPLACE

텍스트 문자열의 일부를 다른 텍스트 문자열로 대체합니다. 이 함수를 사용하여 문자 및 숫자(텍스트로 자동 변환되는)를 대체할 수 있습니다. 함수 결과는 항상 텍스트로 표시됩니다. 텍스트로 대체된 숫자를 사용하여 추가 계산을 수행하려면 VALUE 함수를 사용하여 해당 텍스트를 다시 숫자로 변환해야 합니다.

숫자를 포함하는 모든 텍스트는 숫자로 해석하므로 텍스트로 자동 변환하지 않으려는 경우 따옴표로 묶어야 합니다.

Syntax

REPLACE("Text"; 위치; 길이; "새텍스트")

Text는 그 일부를 바꾸려는 텍스트를 나타냅니다.

Position은 교체가 시작되는 텍스트 내의 위치를 참조합니다.

길이는 대체될 Text의 문자 수입니다.

새텍스트은 대체될 Text를 참조합니다.

Example

=REPLACE("1234567";1;1;"444")는 "444234567"을 반환합니다. 위치 1의 문자는 완전히 새로운 텍스트로 교체됩니다.

REPT

주어진 복사본 Number만큼 문자열을 반복합니다.

Syntax

REPT("Text"; Number)

Text은 반복할 텍스트입니다.

Number는 반복되는 횟수입니다.

Example

=REPT("안녕하세요";2)는 안녕하세요안녕하세요 를 반환합니다.

tip

Refer to the REPT wiki page for more details about this function.


RIGHT

텍스트의 마지막 문자(들)를 반환합니다.

Syntax

RIGHT("Text" [; Number])

Text는 오른쪽에 놓이도록 고정된 텍스트입니다.

Number (optional) is the number of characters from the right part of the text. If this parameter is not defined, one character is returned.

Example

=RIGHT("Sun";2)는 un 을 반환합니다.

RIGHTB

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

tip

This function is available since LibreOffice 4.2.


Syntax

RIGHTB("Text" [; Number_bytes])

Text is the text of which the right part is to be determined.

Number_bytes (optional) specifies the number of characters you want RIGHTB to extract, based on bytes. If this parameter is not defined, one byte is returned.

Example

RIGHTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead).

RIGHTB("中国";2) returns "国" (2 bytes constitute one complete DBCS character).

RIGHTB("中国";3) returns " 国" (3 bytes constitute one half DBCS character and one whole DBCS character; a space is returned for the first half).

RIGHTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters).

RIGHTB("office";3) returns "ice" (3 non-DBCS characters each consisting of 1 byte).

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

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every regular expression metacharacter or operator with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in - LibreOffice Calc - Calculate.

warning

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".


Syntax

SEARCH("FindText"; "Text" [; Position])

FindText는 찾을 텍스트입니다.

Text는 검색을 시작할 위치에 있는 텍스트입니다.

Position은 텍스트에서 검색을 시작할 위치입니다.(선택 사항)

Example

=SEARCH(54;998877665544)는 10을 값으로 반환합니다.

SUBSTITUTE

문자열의 이전 텍스트를 새 텍스트로 대체합니다.

Syntax

SUBSTITUTE("Text"; "SearchText"; "NewText" [; Occurrence])

Text는 교체될 텍스트 세그먼트의 텍스트입니다.

검색텍스트는 대체될 텍스트 세그먼트입니다.(횟수)

새텍스트은 텍스트 세그먼트를 교체할 텍스트입니다.

빈도은 교체될 텍스트 검색이 발견됨을 가리킵니다. 이 매개 변수를 비워두면 모든 검색 텍스트를 교체합니다. (선택 사항)

Example

=SUBSTITUTE("123123123";"3";"abc")는 12abc12abc12abc를 반환합니다.

=SUBSTITUTE("123123123";"3";"abc";2)는 12312abc123을 반환합니다.

T

이 함수는 대상 텍스트를 반환하거나, 대상이 텍스트가 아닌 경우 빈 텍스트 문자열을 반환합니다.

Syntax

T(Values)

만약 이 텍스트 문자열이거나 텍스트 문자열에 대한 참조일 경우, T 가 반환됩니다. 그렇지 않을 경우에는 빈 텍스트 문자열을 반환합니다.

Example

=T(12345)는 빈 문자열을 반환합니다.

=T("12345")는 문자열 12345를 반환합니다.

TEXT

Converts a value into text according to a given format.

Syntax

TEXT(Value; Format)

Value is the value (numerical or textual) to be converted.

서식은 서식을 지정하는 텍스트입니다. 셀 서식에 설정된 언어에 따라 소수 및 천단위 구분 기호를 사용합니다.

Example

=TEXT(12.34567;"###.##")는 텍스트 12.35를 반환합니다.

=TEXT(12.34567;"000.00")는 텍스트 012.35를 반환합니다.

=TEXT("xyz";"=== @ ===") returns the text === xyz ===

tip

See also Number format codes: custom format codes defined by the user.


TRIM

문자열에서 공백을 제거하여 단어 사이에 공백을 하나만 남깁니다.

Syntax

TRIM("Text")

Text refers to text in which spaces are to be removed.

Example

=TRIM(" hello world ") returns hello world without leading and trailing spaces and with single space between words.

UNICHAR

유니코드 문자나 글자를 코드 번호로 변환합니다.

Syntax

UNICHAR(number)

Example

=UNICHAR(169)는 저작권 문자인 ©를 반환합니다.

tip

See also the UNICODE() function.


UNICODE

텍스트 문자열에서 첫 번째 유니코드 문자의 숫자 코드를 반환합니다.

Syntax

UNICODE("Text")

Example

=UNICODE("©")는 저작권 문자의 유니코드 번호인 169를 반환합니다.

tip

See also the UNICHAR() function.


UPPER

text 필드에 지정된 문자열을 대문자로 변환합니다.

Syntax

UPPER("Text")

Text는 대문자로 변경할 소문자들을 참조합니다.

Example

=UPPER("Good Morning")은 GOOD MORNING을 반환합니다.

Please support us!