ID EN
#Date and time

YEAR

Excel Functions 🇮🇩 Bahasa Indonesia

Dapatkan tahun dari sebuah tanggal

Syntax

EXCEL
=YEAR(date)

Arguments

Parameter Deskripsi
date A valid Excel date.

Return Value

Tahun sebagai angka 4 digit

Details

Fungsi YEAR mengembalikan tahun suatu tanggal sebagai angka 4 digit. YEAR hanya membutuhkan satu argumen, tanggal, yang harus berupa tanggal yang valid. Tanggal bisa berupa sel yang berisi tanggal, string tanggal, atau rumus yang mengembalikan tanggal. Secara internal, Excel mengonversi tanggal menjadi nomor seri mengikuti sistem tanggalnya sendiri. Misalnya, jika diberi tanggal "23-Agustus-2012", YEAR akan menghasilkan tahun 2021: Fungsi YEAR hanya memerlukan satu argumen, yang harus berupa tanggal yang valid atau nilai yang dapat dikonversi oleh Excel menjadi tanggal yang valid. Dengan tanggal 20 Januari 2026, di sel A1, rumus berikut akan menghasilkan 2026: Perhatikan bahwa Anda dapat menggunakan YEAR untuk mengekstrak tahun dari tanggal yang dimasukkan sebagai teks: Namun, menggunakan teks untuk tanggal dapat menyebabkan hasil yang tidak terduga pada komputer yang menggunakan pengaturan tanggal regional berbeda. Secara umum, lebih baik menyediakan

Contoh

Example 1

The YEAR function returns the year of a date as a 4-digit number. YEAR takes just one argument, date, which must be a valid date. Date can be a cell c

EXCEL
=YEAR("23-Aug-2012") // returns 2012
Basic examples

The YEAR function requires just one argument, which must be a valid date or a value that Excel can convert into a valid date. With the date January 20

EXCEL
=YEAR(A1) // returns 2026
Basic examples

Note that you can use YEAR to extract the year from a date entered as text:

EXCEL
=YEAR("1/20/2026") // returns 2026
Basic examples

You can easily combine the YEAR function with other Excel functions. For example, to get the current year, you can use YEAR with the TODAY function li

EXCEL
=YEAR(TODAY()) // returns current year
Basic examples

Using the DATE function, you can extract a year from cell A1 and use it to create the date January 1 in the same year, like this:

EXCEL
=DATE(YEAR(A1),1,1) // first day of same year
Get year from date

Use the DATE function to extract just the year from a date. In the worksheet below, the formula in D5 is:

EXCEL
=YEAR(B5)

See Also

MONTH DAY DATE EDATE EOMONTH