ID EN
#Text

LEFT

Excel Functions 🇮🇩 Bahasa Indonesia

Ekstrak teks dari kiri string

Syntax

EXCEL
=LEFT(text, [num_chars])

Arguments

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

Return Value

Satu atau lebih karakter.

Details

Fungsi LEFT mengekstrak sejumlah karakter tertentu dari sisi kiri 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, defaultnya adalah 1. Jika num_chars lebih besar dari jumlah karakter yang tersedia, LEFT mengembalikan seluruh string teks. Meskipun LEFT adalah fungsi sederhana, fungsi ini muncul di banyak rumus lanjutan yang menguji atau memanipulasi teks dengan cara tertentu. Untuk mengekstrak teks dengan LEFT, cukup sediakan teks dan jumlah karakter yang akan diekstraksi. Rumus di bawah ini menunjukkan cara mengekstrak satu, dua, dan tiga karakter dengan LEFT: Jika argumen opsional num_chars tidak

Contoh

LEFT function basics

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

EXCEL
=LEFT("apple",1) // returns "a"
=LEFT("apple",2) // returns "ap"
=LEFT("apple",3) // returns "app"
LEFT function basics

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

EXCEL
=LEFT("ABC") // returns "A"
LEFT function basics

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

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

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

EXCEL
=LEFT(1000,3) // returns "100" as text
Example - abbreviate month names

The LEFT function can be used to abbreviate text values. For example, to extract the first three characters of "January" you can use LEFT like this:

EXCEL
=LEFT("January",3) // returns "Jan"
Example - abbreviate month names

Of course, it doesn't make sense to abbreviate a text string that you have to type into a formula. A more typical example is to abbreviate text values

EXCEL
=LEFT(B5,3)

See Also

RIGHT MID LEN TEXTBEFORE TEXTAFTER TEXTSPLIT