fungsi

Fungsi teks

Bagian ini berisi keteranganTeksfungsi.

Untuk mengakses fungsi ini...

Sisip - Fungsi - Kategori Teks


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

Cocokkan dan ekstrak atau secara opsional mengganti teks menggunakan ekspresi reguler.

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

Dapatkan beberapa konten web dari URI.

FILTERXML

Menerapkan ekspresi XPath ke dokumen XML.

ENCODEURL

Mengembalikan untai URL yang disandikan.

BAHTTEXT

Mengonversi angka menjadi teks Thailand, termasuk nama mata uang Thailand.

Sintaksis

BAHTTEXT(Angka)

Nomor adalah nomor apa pun. "Baht" ditambahkan ke bagian integral dari angka, dan "Satang" ditambahkan ke bagian desimal dari angka.

Contoh

=BAHTTEXT(12.65) mengembalikan string dalam karakter Thailand dengan arti "Dua Belas Baht dan Enam Puluh Lima 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.

Sintaksis

BASE(Number; Radix [; MinimumLength])

Nilai adalah nilai yang akan diperiksa.

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

MinimumLength (opsional) menentukan panjang minimum dari urutan karakter yang telah dibuat. Jika teks lebih pendek dari panjang minimum yang ditunjukkan, angka nol ditambahkan di sebelah kiri string.

Contoh

=BASE(17;10;4) mengembalikan 0017 di sistem desimal.

=BASE(17;2) mengembalikan 10001 di sistem biner.

=BASE(255;16;4) mengembalikan 00FF di system hexa desimal.

See also

DECIMAL

CHAR

Mengonversi angka menjadi karakter sesuai dengan tabel kode saat ini. Angka tersebut dapat berupa bilangan bulat dua digit atau tiga digit.

Kode lebih dari 127 mungkin bergantung kepada pemetaan karakter sistem Anda (sebagai contoh iso-8859-1, iso-8859-2, Windows-1252, Windows-1250), dan mungkin tak akan portabel.

Sintaksis

CHAR(angka)

Angka adalah angka antara 1 dan 255 yang mewakili nilai kode untuk karakter.

Contoh

=CHAR(100) mengembalikan karakter d.

="abc" & CHAR (10) & "def" memasukkan karakter baris baru ke dalam string.

CLEAN

Semua karakter yang tidak dicetak dihapus dari string.

Sintaksis

CLEAN("Teks")

Teks merujuk pada teks yang digunakan untuk menghapus semua karakter yang tidak dapat dicetak.

Contoh

=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

Mengembalikan kode numerik untuk karakter pertama dalam string teks.

Sintaksis

CODECODE("Text")

Teks adalah teks yang dapat ditemukan kode karakter pertama.

Kode lebih dari 127 mungkin bergantung kepada pemetaan karakter sistem Anda (sebagai contoh iso-8859-1, iso-8859-2, Windows-1252, Windows-1250), dan mungkin tak akan portabel.

Contoh

=CODE("Hieronymus") mengembalikan 72, =CODE ("hieroglyphic") mengembalikan 104.

note

Kode yang digunakan di sini tidak merujuk ke ASCII, tetapi ke tabel kode yang saat ini dimuat.


CONCATENATE

Menggabungkan beberapa string teks menjadi satu string.

Sintaksis

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

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

Contoh

=CONCATENATE("Selamat ";"Pagi ";"Bu ";"Doe") mengembalikan: Selamat Pagi Bu Doe.

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.

Sintaksis

DECIMAL("Teks"; 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.

Contoh

=DECIMAL("17";10) mengembalikan nilai 17.

=DECIMAL("FACE";16) mengembalikan nilai 64206.

=DECIMAL("0101";2) mengembalikan nilai 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.

Anda mengatur format mata uang dalam pengaturan sistem anda.

Sintaksis

DOLLAR(Value [; Decimals])

Nilai adalah angka, referensi ke sel yang berisi angka, atau rumus yang mengembalikan angka.

Desimal adalah jumlah opsional tempat desimal.

Contoh

=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

Membandingkan dua string teks dan mengembalikan TRUE jika identik.Fungsi ini peka terhadap huruf besar-kecil.

Sintaksis

EXACT("Teks1"; "Teks2")

Nilai adalah nilai yang akan diperiksa.

Nilai adalah nilai yang akan diperiksa.

Contoh

=EXACT("microsystems";"Microsystems") mengembalikan nilai FALSE.

FIND

Mengembalikan posisi string teks dalam string lain.Anda juga dapat menentukan di mana memulai pencarian. Istilah pencarian dapat berupa angka atau serangkaian karakter. Pencarian bersifat hal-hal yang sensitif.

Sintaksis

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

Nilai adalah nilai yang akan diperiksa.

Teks adalah teks tempat pencarian dilakukan.

Posisi (opsional) adalah posisi dalam teks dari mana pencarian dimulai.

Contoh

=FIND(76;998877665544) mengembalikan nilai 6.

FIXED

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

Sintaksis

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.

Contoh

=FIXED(1234567.89;3) mengebalikan nilai 1,234,567.890 sebagai teks string.

=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

Mengembalikan karakter pertama atau karakter teks.

Sintaksis

LEFT("Text" [; Number])

Teks adalah teks di mana kata-kata parsial awal harus ditentukan.

Nomor (opsional) menentukan jumlah karakter untuk teks awal. Jika parameter ini tidak ditentukan, satu karakter dikembalikan.

Contoh

=KIRI("keluaran";3)kembali "keluar".

LEFTB

Mengembalikan karakter pertama dari teks DBCS.

tip

Fungsi ini tersedia sejak LibreOffice 4.2.


Sintaksis

LEFTB("Text" [; Number_bytes])

Teks adalah teks di mana kata-kata parsial awal harus ditentukan.

Jumlah_byte(opsional) menentukan jumlah karakter yang Anda ingin LEFTB untuk mengekstrak, berdasarkan byte. Jika parameter ini tidak ditentukan, satu karakter dikembalikan.

Contoh

=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

Mengembalikan panjang string termasuk spasi.

Sintaksis

LEN ("Teks")

Teks adalah teks yang panjangnya harus ditentukan.

Contoh

=LEN("Selamat Siang") mengembalikan 14.

=LEN(12345.67) mengembalikan 8.

LENB

Untuk bahasa set karakter byte ganda (DBCS), mengembalikan jumlah byte yang digunakan untuk mewakili karakter dalam string teks.

tip

Fungsi ini tersedia sejak LibreOffice 4.2.


Sintaksis

LENB ("Teks")

Teks adalah teks yang panjangnya harus ditentukan.

Contoh

LENB("中") mengembalikan 2 (1 karakter DBCS yang terdiri dari 2 byte).

LENB("中国") mengembalikan 4 (2 karakter DBCS masing-masing terdiri dari 2 byte).

LENB ("kantor") mengembalikan 6 (6 karakter non-DBCS masing-masing terdiri dari 1 byte).

=LENB("Good Afternoon") returns 14.

= LENB (12345.67) mengembalikan 8.

LOWER

Mengonversi semua huruf besar dalam string teks menjadi huruf kecil.

Sintaksis

LOWER("Teks")

Nilai adalah nilai yang akan diperiksa.

Contoh

=LOWER("Sun") mengembalikan sun.

MID

Menghasilkan teks string dari teks. Parameter menentukan posisi awal dan nomor karakter.

Sintaksis

MID("Teks"; Mulai; Nomor)

Teks adalah teks yang berisi karakter yang diekstrak.

Mulai adalah posisi pertama karakter dalam teks yang diekstrak.

Nomor menentukan nomor karakter pada bagian teks.

Contoh

=MID("office";2;2) mengembalikan ff.

MIDB

Mengembalikan untai teks dari teks DBCS. Parameter menentukan posisi awal dan nomor karakter.

tip

Fungsi ini tersedia sejak LibreOffice 4.2.


Sintaksis

MIDB("Teks"; Mulai; Nomor_bita)

Teks adalah teks yang berisi karakter yang diekstrak.

Mulai adalah posisi pertama karakter dalam teks yang diekstrak.

Nomor_bita menentukan jumlah karakter yang akan dikembalikan dari teks, dalam bita.

Contoh

=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

Mengapitalisasi huruf pertama dalam semua kata dari untai teks.

Sintaksis

PROPER("Teks")

Nilai adalah nilai yang akan diperiksa.

Contoh

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

REPLACE

mengganti bagian dari untuk teks dengan untai teks yang berbeda. Fungsi ini dapat digunakan untuk mengganti karakter dan angka (yang secara otomatis dikonversi menjadi teks). Hasil dari fungsi tersebut selalu ditampilkan sebagai teks. Jika Anda berniat melakukan penghitungan lebih lanjut dengan angka yang telah diganti oleh teks, Anda harus mengonversinya kembali ke angka menggunakan fungsi VALUE.

Setiap teks berisi angka harus ditutup dengan tanda petik jika Anda tidak ingin angka tersebut dianggap sebagai nomor dan secara otomatis dikonversi ke teks.

Sintaksis

REPLACE("Teks"; Posisi; Panjang; "TeksBaru")

Teks mengacu pada bagian teks yang akan diganti.

Posisi mengacu pada posisi di dalam teks di mana penggantian akan dimulai.

Panjang adalah nomor karakter dalam Teks yang akan diganti.

TeksBaru mengacu pada teks yang menggantikan Teks.

Contoh

=REPLACE("1234567";1;1;"444") mengembalikan "444234567". Satu karakter pada posisi 1 diganti sepenuhnya dengan TeksBaru.

REPT

Mengulang karakter untai dengan jumlah salinan yang diberikan.

Sintaksis

REPT("Teks"; Nomor)

Nilai adalah nilai yang akan diperiksa.

Nilai adalah nilai yang akan diperiksa.

Contoh

=REPT("Selamat pagi";2) mengembalikan Selamat pagiSelamat pagi.

tip

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


RIGHT

Mengembalikan karakter terakhir atau karakter teks.

Sintaksis

RIGHT("Text" [; Number])

Teks adalah teks yang bagian yang tepat harus ditentukan.

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

Contoh

=RIGHT("Sun";2) mengembalikan nilai un.

RIGHTB

Mengembalikan karakter terakhir atau karakter teks dengan set karakter byte ganda (DBC).

tip

Fungsi ini tersedia sejak LibreOffice 4.2.


Sintaksis

RIGHTB("Text" [; Number_bytes])

Teks adalah teks yang bagian yang tepat harus ditentukan.

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.

Contoh

RIGHTB("中国";1) mengembalikan "" (1 byte hanya setengah karakter DBCS dan karakter spasi dikembalikan sebagai gantinya).

RIGHTB("中国";2) mengembalikan "国" (2 byte merupakan satu karakter DBCS lengkap).

RIGHTB("中国";3) mengembalikan "国" (3 byte merupakan setengah karakter DBCS dan satu karakter DBCS keseluruhan; spasi dikembalikan untuk babak pertama).

RIGHTB("中国";4) mengembalikan "中国" (4 byte merupakan dua karakter DBCS lengkap).

RIGHTB("kantor";3) mengembalikan "es" (3 karakter non-DBCS masing-masing terdiri dari 1 byte).

SEARCH

Mengembalikan posisi segmen teks dalam string karakter. Anda dapat mengatur awal pencarian sebagai opsi. Teks pencarian dapat berupa angka atau urutan karakter apa pun. Pencarian tidak peka huruf besar-kecil. Jika teks tidak ditemukan, mengembalikan kesalahan 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".


Sintaksis

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

Nilai adalah nilai yang akan diperiksa.

Teks adalah teks tempat pencarian akan dilakukan.

Posisi (opsional) adalah posisi dalam teks tempat pencarian dimulai.

Contoh

=MENCARI(54;998877665544)mengembalikan 10.

SUBSTITUTE

Mengganti teks baru dengan teks lama dalam sebuah string.

Sintaksis

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

Teksadalah teks tempat segmen teks akan dipertukarkan.

TeksPencarianadalah segmen teks yang akan diganti (beberapa kali).

TeksBaruadalah teks yang akan menggantikan segmen teks.

Kejadian (opsional) menunjukkan kemunculan teks pencarian yang akan diganti. Jika parameter ini tidak ada, teks pencarian akan diganti seluruhnya.

Contoh

SUBTITUSI("123123123";"3";"abc") mengembalikan 12abc12abc12abc.

=SUBTITUSI("123123123";"3";"abc";2) mengembalikan 12312abc123.

T

Fungsi ini mengembalikan teks target, atau string teks kosong jika targetnya bukan teks.

Sintaksis

T(nilai)

JikaNilaiadalah string teks atau mengacu pada string teks, T mengembalikan string teks itu; selain itu mengembalikan string teks kosong.

Contoh

=T(12345) mengembalikan string kosong.

=T("12345") mengembalikan string 12345.

TEXT

Converts a value into text according to a given format.

Sintaksis

TEXT(Nilai; Format)

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

Format adalah teks yang mendefinisikan format. Gunakan pemisah desimal dan ribuan sesuai dengan bahasa yang diatur dalam format sel.

Contoh

=TEKS(12.34567;"###.##") mengembalikan teks 12,35

= TEXT (12.34567; "000.00") mengembalikan teks 012.35

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

tip

Lihat jugaKode format angka: kode format khusus yang ditentukan oleh pengguna.


TRIM

Menghapus spasi dari string, hanya menyisakan satu karakter spasi di antara kata-kata.

Sintaksis

TRIM ("Teks")

Teks merujuk ke teks di mana spasi harus dihapus.

Contoh

=TRIM(" hello world ") mengembalikan hello world tanpa memimpin dan mengikuti spasi dan dengan satu spasi di antara kata-kata.

UNICHAR

Mengonversi nomor kode menjadi karakter atau huruf Unicode.

Sintaksis

UNICHAR (angka)

Contoh

=UNICHAR(169) mengembalikan karakter Hak Cipta©.

tip

Lihat juga fungsi UNICODE ().


UNICODE

Mengembalikan kode numerik untuk karakter Unicode pertama dalam string teks.

Sintaksis

UNICODE("Teks")

Contoh

=UNICODE("©") mengembalikan nomor Unicode 169 untuk karakter Hak Cipta.

tip

Lihat juga fungsi UNICHAR ().


UPPER

Mengonversi string yang ditentukan dalamteksruas ke huruf besar.

Sintaksis

UPPER ("Teks")

Teks merujuk pada huruf kecil yang ingin Anda konversi menjadi huruf besar.

Contoh

= UPPER ("Selamat Pagi") mengembalikan SELAMAT PAGI.

Mohon dukung kami!