Collabora Office 21.06 ヘルプ
This section contains descriptions of the Text functions.
2 つのテキスト文字列を比較して、同じであれば TRUE を返します。この関数は、大文字と小文字を区別します。
EXACT("テキスト 1"; "テキスト 2")
テキスト 1 は、比較する最初のテキストを指します。
テキスト 2 は、比較する 2 番目のテキストです。
=EXACT("microsystems";"Microsystems") は、FALSE を返します。
ASC 関数は、ASCII およびカタカナ文字を全角から半角に変換します。テキスト文字列を返します。
See https://wiki.documentfoundation.org/Calc/Features/JIS_and_ASC_functions for a conversion table.
ASC("テキスト")
テキスト は、変換される文字を含むテキストです。
JIS 関数も参照。
Converts a value into text according to a given format.
TEXT(Value; Format)
Value is the value (numerical or textual) to be converted.
書式 は、書式を定義するテキストです。小数位と桁の区切りはセル書式に設定されている言語に従います。
=TEXT(12.34567;"###.##") は、テキスト 12.35 を返します。
=TEXT(12.34567;"000.00") は、テキスト 012.35 を返します
=TEXT("xyz";"=== @ ===") returns the text === xyz ===
See also Number format codes: custom format codes defined by the user.
For double-byte character set (DBCS) languages, returns the number of bytes used to represent the characters in a text string.
LENB("テキスト")
テキスト は、その長さが決定されるテキストです。
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") は、14 を返します。
=LENB(12345.67) は、8 を返します。
JIS 関数は、ASCII およびカタカナ文字を半角から全角に変換します。テキスト文字列を返します。
See https://wiki.documentfoundation.org/Calc/Features/JIS_and_ASC_functions for a conversion table.
JIS("テキスト")
テキスト は、変換される文字を含むテキストです。
ASC 関数も参照。
Returns a text string of a DBCS text. The parameters specify the starting position and the number of characters.
MIDB("Text"; Start; Number_bytes)
テキスト は、抽出する文字を含むテキストです。
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.
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).
Returns the first characters of a DBCS text.
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.
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).
Returns the last character or characters of a text with double bytes characters sets (DBCS).
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.
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).
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.
FIND("FindText"; "Text" [; Position])
検索テキスト は、検索されるテキストを指します。
テキスト は、検索を実行するテキストです。
位置 (オプション) は、検索を開始するテキスト内の位置です。
=FIND(76;998877665544) は、6 を返します。
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).
SEARCH("FindText"; "Text" [; Position])
検索テキスト は、検索されるテキストです。
テキスト は、検索を実行するテキストです。
位置 (オプション) は、検索を開始するテキスト内の位置です。
=SEARCH(54;998877665544) は、10 を返します。
number system の文字を含むテキストを、指定された基数の正の整数に変換します。 基数は 2 から 36 の範囲とします。スペースとタブは無視されます。テキスト フィールドでは、大文字と小文字は区別されません。
基数が 16 の場合、先頭に付いている x、X、0x、または 0X、および末尾に付いている h または H は無視されます。基数が 2 の場合、末尾に付いている b または B は無視されます。記数法に属さないその他の文字はエラーになります。
DECIMAL("テキスト"; 基数)
テキスト は、変換されるテキストです。A1 などの 16 進数とセル A1 を区別するために、たとえば "A1" または "FACE" のように数字を引用符で囲んでください。
Radix は、記数法の底を示します。これは、2 から 36 の任意の正の整数の場合があります。
=DECIMAL("17";10) は、17 を返します。
=DECIMAL("FACE";16) は、64206 を返します。
=DECIMAL("0101";2) は、5 を返します。
この関数は、ターゲットテキストを返します。ターゲットがテキストでない場合は、空白の文字列を返します。
T(値)
値 がテキスト文字列またはテキスト文字列を参照する場合、T はテキスト文字列を返します。そのほかの場合は、空白のテキスト文字列を返します。
=T(12345) は、空の文字列を返します。
=T("12345") は、文字列 12345 を返します。
この関数は、文字列の一部を、別の文字列に置き換えます。文字列または数値の一部分を置換します。結果は常に文字列で返るため、数値は自動的に文字列としての数に変換されます。置換された数値を計算に使うには、戻り値を VALUE 関数で数値に変換する必要があります。
数値として認識されたくない (つまり、自動的にテキストに変換してもかまわない) 数字を含むテキストは引用符で囲みます。
REPLACE("テキスト"; 位置; 長さ; "新しいテキスト")
文字列 は、その一部が置換されるテキストです。
位置 は、置換を開始するテキスト内の位置を指します。
長さ は、テキスト 内の置換される文字数です。
新しいテキスト は、テキストを置換するテキストを指します。
=REPLACE("1234567";1;1;"444") は、"444234567" を返します。位置 1 の 1 文字は、完全な新しいテキストに置換されます。
この関数は、文字列の長さを返します。スペースも文字とみなされます。
LEN("テキスト")
テキスト は、その長さが決定されるテキストです。
=LEN("Good Afternoon") は、14 を返します。
=LEN(12345.67) は、8 を返します。
アラビア数字をローマ数字に変換します。変換元の数値は 0 から 3999 までの数値である必要があります。モードには 0 から 4 までの整数を指定できます。
ROMAN(Number [; Mode])
数値 はローマ数字に変換される数値です。
書式 (オプション) は簡略度を示す 1 から 4 の値です。値が大きいほど簡単なローマ数字形式で戻り値が表示されます。
=ROMAN (999) は、CMXCIX を返します。
=ROMAN(999;0) は、CMXCIX を返します。
=ROMAN (999;1) は、LMVLIV を返します。
=ROMAN(999;2) は、XMIX を返します。
=ROMAN(999;3) は、VMIV を返します。
=ROMAN(999;4) は、IM を返します。
コード番号をユニコードキャラクターか文字に変換します。
UNICHAR(number)
=UNICHAR(169) はコピーライト記号である©を返します。
See also the UNICODE() function.
テキスト フィールドに含まれるアルファベット文字を、すべて大文字に変換します。
UPPER("テキスト")
テキスト は、大文字に変換する小文字を指します。
=UPPER("Good Morning") は、GOOD MORNING を返します。
テキストの先頭の文字 (複数の文字も可) を返します。
LEFT("Text" [; Number])
テキスト は、最初の部分ワードが決定されるテキストです。
文字数 (オプション) は、テキストの左 (先頭) から取り出す文字数です。このパラメーターが指定されていない場合、テキストの一番左 (先頭) の文字だけを返します。
=LEFT("output";3) は、「out」を返します。
テキストの文字列を返します。パラメーターは、開始位置と文字数を返します。
MID("テキスト"; 開始; 数値)
テキスト は、抽出する文字を含むテキストです。
開始 は、抽出する文字の最初の文字の位置です。
数値 は、テキストの一部の文字数を指定します。
=MID("office";2;2) は、ff を返します。
テキストの最後の文字 (複数の文字も可) を返します。
RIGHT("Text" [; Number])
テキスト は、右部分が決定されるテキストです。
数値 (オプション) は、テキストの右部分の文字数です。
=RIGHT("Sun";2) は、un を返します。
テキストや文字列の先頭文字のコードを返します。
CODE("テキスト")
テキスト は、先頭文字のコード番号を調べるテキストです。
=CODE("Hieronymus") は 72 を返します。=CODE("hieroglyphic") は 104 を返します。
ここで使用されるコードは ASCII コードではなく、現在使用しているコード表のコードです。
テキスト文字列を数値に変換します。
VALUE("テキスト")
テキスト は、数値に変換されるテキストです。
=VALUE("4321") は、4321 を返します。
テキスト文字列内にあるすべての単語の最初の文字を大文字にします。
PROPER("テキスト")
テキスト は、変換されるテキストを指します。
=PROPER("the document foundation") returns The Document Foundation.
ローマ数字を表す文字列をアラビア数字に変換します。0 から 3999 までの数が有効です。
ARABIC("テキスト")
文字列 はローマ数字を表す文字列です。
=ARABIC("MXIV") は、1014 を返します。
=ARABIC("MMII") は、2002 を返します。
指定された 数 だけ文字列を繰り返します。
REPT("テキスト"; 数値)
テキスト は、繰り返されるテキストです。
数値 は、繰り返し回数です。
戻り値の長さは最高255文字です。
=REPT("Good morning";2) は、Good morningGood morning を返します。
指定された小数位を持ち、任意で千単位の桁区切りが付いたテキストとして、数を返します。
FIXED(Number; Decimals [; NoThousandsSeparators])
数値 は、書式設定される数値です。
小数位 は、表示する小数点以下の桁数です。
桁区切りの数 (オプション) は、桁区切りを使用するかどうかを決定します。パラメーターが 0 以外の数値の場合、桁区切りは無効になります。パラメーターが 0 に等しいか、まったくない場合、使用している 言語設定 の桁区切りが表示されます。
=FIXED(1234567.89;3) は、テキスト文字列として 1,234,567.890 を返します。
=FIXED(1234567.89;3;1) は、テキスト文字列として 1234567.890 を返します。
指定された小数点以下の桁数に丸められた通貨形式の金額に数値を変換します。通貨に変換する数字を「値」フィールドに入力します。オプションで「小数位」フィールドに小数点以下の桁数を入力することもできます。値が指定されていない場合、通貨形式のすべての数字は、小数位 2 桁で表示されます。
自分のシステム設定に通貨書式を設定します。
DOLLAR(Value [; Decimals])
値 は、数値、数値を含むセルへの参照、または数値を返す数式です。
小数 は、小数点以下の桁数 (オプション) です。
=DOLLAR(255) は、$255.00 を返します。
=DOLLAR(367.456;2) は、$367.46 を返します。言語設定 に対応する小数点を使用してください。
指定の基数で正の整数を記数法のテキストに変換します。0~9 の数字と A~Z のアルファベット文字が使用されます。
BASE(Number; Radix [; MinimumLength])
数値 は、変換される正の整数です。
Radix は、記数法の底を示します。これは、2 から 36 の任意の正の整数の場合があります。
最小長さ (オプション) は、作成された文字列の最小長さを決定します。指定した最小長さより短い結果には、左にゼロが追加されます。
=BASE(17;10;4) は、10 進数の 0017 を返します。
=BASE(17;2) は、2 進数の 10001 を返します。
=BASE(255;16;4) は、16 進数の 00FF を返します。
数値を、タイの通貨名を含むタイ語のテキストに変換します。
BAHTTEXT(数値)
数値 は任意の数字です。数値の整数部に「バーツ」が追加され、数値の小数部に「サタン」が追加されます。
=BAHTTEXT(12.65) は、「12 バーツ 65 サタン」を意味するタイ文字の文字列を返します。
文字列から印刷されない文字を削除します。
CLEAN("テキスト")
テキスト は、印刷できないすべての文字を削除するテキストを指します。
文字列のアルファベット文字を、すべて小文字に変換します。
LOWER("テキスト")
テキスト は、変換されるテキストを指します。
=LOWER("Sun") は、sun を返します。
文字列の先頭文字のユニコードを返します。
UNICODE("Text")
=UNICODE("©") はユニコードでコピーライト記号を示す 169 を返します。
See also the UNICHAR() function.
文字列の間に空白文字を 1 文字分だけ残し、文字列から空白を削除します。
TRIM("テキスト")
Text refers to text in which spaces are to be removed.
=TRIM(" hello world ") returns hello world without leading and trailing spaces and with single space between words.
文字列内の古いテキストを新しいテキストで置換します。
SUBSTITUTE("Text"; "SearchText"; "NewText" [; Occurrence])
テキスト は、テキストセグメントが交換されるテキストです。
検索テキスト は、指定回数、置換されるテキストセグメントです。
新しいテキスト は、テキストセグメントを置換するテキストです。
置換文字列 (オプション) は、検索テキストが置換される置換対象を示します。このパラメーターがない場合は、検索テキストが最初から最後まで置換されます。
=SUBSTITUTE("123123123";"3";"abc") は、12abc12abc12abc を返します。
=SUBSTITUTE("123123123";"3";"abc";2) は、12312abc123 を返します。
現在のロケールの文字コード表に従って、数値を文字に変換します。数値は 2 桁または 3 桁の整数の数値です。
CHAR(数値)
数値 は、文字のコード値を表す 1 から 255 の数値です。
=CHAR(100) は、文字 d を返します。
="abc" & CHAR(10) & "def" 文字列に改行文字を挿入します。
複数の文字列を 1 つのテキスト文字列に結合します。
CONCATENATE(String 1 [; String 2 [; … [; String 255]]])
String 1[; String 2][; … ;[String 255]] are strings or references to cells containing strings.
=CONCATENATE("Good ";"Morning ";"Mrs. ";"Doe") は、Good Morning Mrs. Doe を返します。