Buat tanggal dengan tahun, bulan, dan hari
=DATE(year, month, day)
| Parameter | Deskripsi |
|---|---|
year |
Number for year. |
month |
Number for month. |
day |
Number for day. |
For example, you can use the DATE function to create the dates January 1, 1999, and June 1, 2010, with the following syntax:
=DATE(1999,1,1) // returns Jan 1, 1999
=DATE(2010,6,1) // returns Jun 1, 2010
The DATE function is useful for assembling dates that need to change dynamically based on other inputs in a worksheet. For example, with 2018 in cell
=DATE(A1,4,15) // Apr 15, 2018
The DATE function can be used to supply dates as inputs to other functions like SUMIFS or COUNTIFS, since you can easily assemble a date using year, m
=COUNTIF(range,">"&DATE(A1,B1,C1))
To return the first day of the current year, you can use the DATE function like this:
=DATE(YEAR(TODAY()),1,1) // first of year