ID EN
#Date and time

WEEKDAY

Excel Functions 🇮🇩 Bahasa Indonesia

Dapatkan hari dalam seminggu sebagai angka

Syntax

EXCEL
=WEEKDAY(serial_number, [return_type])

Arguments

Parameter Deskripsi
serial_number The date for which you want to get the day of week.
return_type [optional] A number representing day of week mapping scheme. Default is 1.

Return Value

Angka antara 0 dan 7.

Details

The WEEKDAY function takes a date and returns a number between 1-7 representing the day of the week. The WEEKDAY function takes two arguments: serial_number and return_type. Serial_number should be a valid Excel date in serial number format. Return_type is an optional numeric code that controls which day of the week is considered the first day. Secara default, WEEKDAY mengembalikan 1 untuk hari Minggu dan 7 untuk hari Sabtu, seperti terlihat pada tabel di bawah ini: WEEKDAY mendukung beberapa skema penomoran, dikendalikan oleh argumen return_type. Return_type bersifat opsional dan defaultnya adalah 1. Tabel di bawah ini menunjukkan kode return_type yang tersedia, hasil numerik setiap kode, dan hari mana yang merupakan hari pertama dalam skema pemetaan. Note: the WEEKDAY function will return a value even when the date is empty. Berhati-hatilah untuk menjebak ini

Contoh

Examples

By default and without a value fore return_type, WEEKDAY starts counting on Sunday:

EXCEL
=WEEKDAY("3-Jan-21") // Sunday, returns 1
=WEEKDAY("4-Jan-21") // Monday, returns 2
Examples

To configure WEEKDAY to start on Monday, set return_type to 2*:*

EXCEL
=WEEKDAY("3-Jan-21",2) // Sunday, returns 7
=WEEKDAY("4-Jan-21",2) // Monday, returns 1
Examples

In the example shown above, the formula in D5 (copied down) is:

EXCEL
=WEEKDAY(B5) // Sunday start
Examples

The formula in E5 (copied down) is:

EXCEL
=WEEKDAY(B5,2) // Monday start