ID EN
#Text

RIGHT

Excel Functions 🇮🇩 Bahasa Indonesia

Ekstrak teks dari kanan string

Syntax

EXCEL
=RIGHT(text, [num_chars])

Arguments

Parameter Deskripsi
text The text from which to extract characters on the right.
num_chars [optional] The number of characters to extract, starting on the right. Default = 1.

Return Value

Satu atau lebih karakter.

Details

Fungsi RIGHT mengekstrak sejumlah karakter tertentu dari sisi kanan string teks yang disediakan. Argumen pertama, teks, adalah string teks yang akan diekstrak. Ini biasanya merupakan referensi ke sel yang berisi teks. Argumen kedua, disebut num_chars, menentukan jumlah karakter yang akan diekstraksi. Jika num_chars tidak tersedia, maka defaultnya adalah 1. Jika num_chars lebih besar dari jumlah karakter yang tersedia, RIGHT akan mengembalikan seluruh string teks. Meskipun RIGHT adalah fungsi sederhana, fungsi ini muncul dalam banyak rumus lanjutan yang menguji atau memanipulasi teks dengan cara tertentu. Untuk mengekstrak teks dengan KANAN, cukup sediakan teks dan jumlah karakter yang akan diekstraksi. Rumus di bawah ini menunjukkan cara mengekstrak satu, dua, dan tiga karakter dengan KANAN: Jika argumen opsional num_chars i

Contoh

RIGHT function basics

To extract text with RIGHT, just provide the text and the number of characters to extract. The formulas below show how to extract one, two, and three

EXCEL
=RIGHT("apple",1) // returns "e"
=RIGHT("apple",2) // returns "le"
=RIGHT("apple",3) // returns "ple"
RIGHT function basics

If the optional argument num_chars is not provided, it defaults to 1:

EXCEL
=RIGHT("ABC") // returns "C"
RIGHT function basics

If num_chars exceeds the length of the text string, RIGHT returns the entire string:

EXCEL
=RIGHT("apple",100) // returns "apple"
RIGHT function basics

When RIGHT is used on a numeric value, the result is text:

EXCEL
=RIGHT(1500,3) // returns "500" as text
Example - extract state abbreviation

The RIGHT function can be used to extract a specific number of characters from the end of a text string. For example, to extract the last two characte

EXCEL
=RIGHT("Los Angeles, CA",2) // returns "CA"
Example - extract state abbreviation

Of course, it doesn't make sense to extract text from a text string that you have to type into a formula. A more typical example is to work with value

EXCEL
=RIGHT(B5,2)

See Also

LEFT MID LEN TEXTBEFORE TEXTAFTER TEXTSPLIT