Purpose

Return value

Syntax

=TODAY()

Using the TODAY function

The TODAY function returns the current date, and will continually update each time the worksheet is updated. Use F9 to force the worksheet to recalculate and update the value.

The value returned by the TODAY function is a standard Excel date . To display the result as a date, apply a date number format . Optionally customize the number format as you like. If you want the current date with a time value, use the NOW function .

Examples

The TODAY function can be used on its own, or combined with other functions. The formulas below show how the TODAY function can be used in various ways:

=TODAY()  // current date
=TODAY()-7  // one week in past
=TODAY()+7  // one week in future
=TODAY()+90  // 90 days from today
=EDATE(TODAY(),3)  // 3 months from today
=EDATE(TODAY(),12)  // 1 year from today
=EDATE(TODAY(),-12)  // 1 year in the past
=EOMONTH(TODAY(),-1)+1  // first day of current month
=TODAY()+TIME(18,0,0)  // today at 6:00 PM
=TODAY()+1+TIME(12,0,0)  // tomorrow at noon

Static date and time

If you need a static date and time that won’t change, you can use the following shortcuts:

  • Insert current date - Control + ;
  • Insert current time - Control + Shift + :

To enter both values in a single cell, enter the date, a space, then the time.

Formatting results

The result of TODAY is a serial number representing a valid Excel date . You can format the value returned by TODAY using any standard date format . You can use the TEXT function to build a text message that includes the current date:

="The current date is "&TEXT(TODAY(),"mmm d")

To return a message like “The current date is May 31”.

Purpose

Return value

Syntax

=WEEKDAY(serial_number,[return_type])
  • 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.

Using the WEEKDAY function

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. By default, WEEKDAY returns 1 for Sunday and 7 for Saturday, as seen in the table below:

ResultMeaning
1Sunday
2Monday
3Tuesday
4Wednesday
5Thursday
6Friday
7Saturday

WEEKDAY supports several numbering schemes, controlled by the return_type argument. Return_type is optional and defaults to 1. The table below shows available return_type codes, the numeric result of each code, and which day is the first day in the mapping scheme.

Return typeNumeric resultDay mapping
none1-7Sunday-Saturday
11-7Sunday-Saturday
21-7Monday-Sunday
30-6Monday-Sunday
111-7Monday-Sunday
121-7Tuesday-Monday
131-7Wednesday-Tuesday
141-7Thursday-Wednesday
151-7Friday-Thursday
161-7Saturday-Friday
171-7Sunday-Saturday

Note: the WEEKDAY function will return a value even when the date is empty. Take care to trap this result if blank dates are possible.

Examples

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

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

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

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

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

=WEEKDAY(B5) // Sunday start

The formula in E5 (copied down) is:

=WEEKDAY(B5,2) // Monday start

Notes

  • By default, WEEKDAY returns 1 for Sunday and 7 for Saturday.
  • WEEKDAY returns a value (7) even if the date is empty.