Excel tools to demonstrate


YEAR, MONTH, DAY, WEEKDAY Functions



Yüklə 119,95 Kb.
səhifə38/56
tarix05.01.2022
ölçüsü119,95 Kb.
#72366
1   ...   34   35   36   37   38   39   40   41   ...   56

YEAR, MONTH, DAY, WEEKDAY Functions


If a cell contains a date, it is easy to strip off the year, month, day, or even weekday with the YEAR, MONTH, DAY, and WEEKDAY functions. In all of the following examples, datecell refers to a cell that contains a date.

To use the YEAR function:

Enter the formula =YEAR(datecell). This returns a 4-digit year such as 1993.



To use the MONTH function:

Enter the formula =MONTH(datecell). This returns a month from 1 (January) to 12 (December).



To use the DAY function:

Enter the formula =DAY(datecell). This returns the day of the month, from 1 to the number of days in the month.



To use the WEEKDAY function:

Enter the formula =WEEKDAY(datecell). This returns a number from 1 to 7, where 1 refers to Sunday, 2 to Monday, and so on. If you want to get the name of the day, such as Thursday, use a VLOOKUP function, as indicated in the exercise below.



Try it! For each date in column A, return the year, month, month name, day, weekday, and weekday name in columns B–G. For the month and weekday names, use the lookup tables given. (Scroll to the right to see them.) Do you recognize these “infamous” dates? Try one more: your own birthdate.



Yüklə 119,95 Kb.

Dostları ilə paylaş:
1   ...   34   35   36   37   38   39   40   41   ...   56




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin