DATE function - Microsoft Support (2024)

Skip to main content

Microsoft

Support

Support

Sign in

Sign in with Microsoft

Sign in or create an account.

Hello,

Select a different account.

You have multiple accounts

Choose the account you want to sign in with.

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 More...Less

Use Excel's DATE function when you need to take three separate values and combine them to form a date.

The DATE function returns the sequential serial number that represents a particular date.

Syntax: DATE(year,month,day)

The DATE function syntax has the following arguments:

  • YearRequired. The value of the year argument can include one to four digits. Excel interprets the year argument according to the date system your computer is using. By default, Microsoft Excel for Windows uses the 1900 date system, which means the first date is January 1, 1900.

    Tip:Use four digits for the year argument to prevent unwanted results. For example, "07" could mean "1907" or "2007." Four digit years prevent confusion.

    • If year is between 0 (zero) and 1899 (inclusive), Excel adds that value to 1900 to calculate the year. For example, DATE(108,1,2) returns January 2, 2008 (1900+108).

    • If year is between 1900 and 9999 (inclusive), Excel uses that value as the year. For example, DATE(2008,1,2) returns January 2, 2008.

    • If year is less than 0 or is 10000 or greater, Excel returns the #NUM! error value.

  • MonthRequired. A positive or negative integer representing the month of the year from 1 to 12 (January to December).

    • If month is greater than 12, month adds that number of months to the first month in the year specified. For example, DATE(2008,14,2) returns the serial number representing February 2, 2009.

    • If month is less than 1, month subtracts the magnitude of that number of months, plus 1, from the first month in the year specified. For example, DATE(2008,-3,2) returns the serial number representing September 2, 2007.

  • DayRequired. A positive or negative integer representing the day of the month from 1 to 31.

    • If day is greater than the number of days in the month specified, day adds that number of days to the first day in the month. For example, DATE(2008,1,35) returns the serial number representing February 4, 2008.

    • If day is less than 1, day subtracts the magnitude that number of days, plus one, from the first day of the month specified. For example, DATE(2008,1,-15) returns the serial number representing December 16, 2007.

Note:Excel stores dates as sequential serial numbers so that they can be used in calculations. January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,447 days after January 1, 1900. You will need to change the number format (Format Cells) in order to display a proper date.

DATE function - Microsoft Support (2)

Syntax: DATE(year,month,day)

For example: =DATE(C2,A2,B2) combines the year from cell C2, the month from cell A2, and the day from cell B2 and puts them into one cell as a date. The example below shows the final result in cell D2.

DATE function - Microsoft Support (3)

Need to insert dates without a formula? No problem. You can insert the current date and time in a cell, or you can insert a date that gets updated. You can also fill data automatically in worksheet cells.

  1. On the Home tab in theNumber section select ether Long DateorShort Date.

  2. Alternatively, right-click the cell(s) you want to changeand selectFormat cells orpress Ctrl+1.On a Mac, Ctrl-click the cells (Command+1 on a Mac).

  3. SelectDatefrom theCategorymenu.

  4. 3. Choose the Locale (location) and Date format you want.

  5. For more information on formatting dates, see Format a date the way you want.

    DATE function - Microsoft Support (4)

You can use the DATE function to create a date that is based on another cell’s date. For example, you can use the YEAR, MONTH, and DAY functions to create an anniversary date that’s based on another cell. Let’s say an employee’s first day at work is 10/1/2016; the DATE function can be used to establish his fifth year anniversary date:

DATE function - Microsoft Support (5)

  1. The DATE function creates a date.

    =DATE(YEAR(C2)+5,MONTH(C2),DAY(C2))

  2. The YEAR function looks at cell C2 and extracts "2012".

  3. Then, "+5" adds 5 years, and establishes "2017" as the anniversary year in cell D2.

  4. The MONTH function extracts the "3" from C2. This establishes "3" as the month in cell D2.

  5. The DAY function extracts "14" from C2. This establishes "14" as the day in cell D2.

If you open a file that came from another program, Excel will try to recognize dates within the data. But sometimes the dates aren't recognizable. This is may be because the numbers don't resemble a typical date, or because the data is formatted as text. If this is the case, you can use the DATE function to convert the information into dates. For example, in the following illustration, cell C2 contains a date that is in the format: YYYYMMDD. It is also formatted as text. To convert it into a date, the DATE function was used in conjunction with the LEFT, MID, and RIGHT functions.

DATE function - Microsoft Support (6)

  1. The DATE function creates a date.

    =DATE(LEFT(C2,4),MID(C2,5,2),RIGHT(C2,2))

  2. The LEFT function looks at cell C2 and takes the first 4 characters from the left. This establishes “2014” as the year of the converted date in cell D2.

  3. The MID function looks at cell C2. It starts at the 5th character, and then takes 2 characters to the right. This establishes “03” as the month of the converted date in cell D2. Because the formatting of D2 set to Date, the “0” isn’t included in the final result.

  4. The RIGHT function looks at cell C2 and takes the first 2 characters starting from the very right and moving left. This establishes “14” as the day of the date in D2.

To increase or decrease a date by a certain number of days, simply add or subtract the number of days to the value or cell reference containing the date.

In the example below, cell A5 contains the date that we want to increase and decrease by 7 days (the value in C5).

DATE function - Microsoft Support (7)

See Also

Add or subtract dates

Insert the current date and time in a cell

Fill data automatically in worksheet cells

YEAR function

MONTH function

DAY function

TODAY function

DATEVALUE function

Date and time functions (reference)

All Excel functions (by category)

All Excel functions (alphabetical)

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

DATE function - Microsoft Support (8)

Microsoft 365 subscription benefits

DATE function - Microsoft Support (9)

Microsoft 365 training

DATE function - Microsoft Support (10)

Microsoft security

DATE function - Microsoft Support (11)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

DATE function - Microsoft Support (12)

Ask the Microsoft Community

DATE function - Microsoft Support (13)

Microsoft Tech Community

Thank you for your feedback!

×

DATE function - Microsoft Support (2024)

FAQs

What is the date function in Microsoft? ›

The DATE function returns the sequential serial number that represents a particular date. The DATE function syntax has the following arguments: Year Required. The value of the year argument can include one to four digits.

Why is the date format not working in Excel? ›

If the date format is not changing in your Excel sheet, most likely your dates are formatted as text and you have to convert them to the date format first.

What does date() mean in Access? ›

the current system date

How do you use the date function in Excel? ›

You will need to change the number format (Format Cells) in order to display a proper date. For example: =DATE(C2,A2,B2) combines the year from cell C2, the month from cell A2, and the day from cell B2 and puts them into one cell as a date. The example below shows the final result in cell D2.

What does to date function do? ›

The TO_DATE function evaluates a character string according to the date-formatting directive that you specify and returns a DATETIME value.

What is the current date function? ›

The CURRENT-DATE function returns a 21-character alphanumeric value that represents the calendar date, time of day, and time differential from Greenwich mean time provided by the system on which the function is evaluated. The function type is alphanumeric.

Why is Excel formula not Recognising date? ›

The most likely problem is that the dates are text not numbers. Try referencing one of the date cells with the formula =ISTEXT(A10) where A10 is one of the problem cells. If the result of the formula is TRUE you know you have the wrong data type, text not numbers.

How do I fix date formatting? ›

Follow these steps:
  1. Select the cells you want to format.
  2. Press CTRL+1.
  3. In the Format Cells box, click the Number tab.
  4. In the Category list, click Date.
  5. Under Type, pick a date format. ...
  6. If you want to use a date format according to how another language displays dates, choose the language in Locale (location).

How do I force date format data validation in Excel? ›

Click on "Data Validation" in the "Data Tools" group. In the Data Validation dialog box, select "Date" under the "Allow" dropdown. Choose the desired start and end date range. Select the correct date format under the "Data" dropdown.

What does date () do? ›

Calling the Date() function (without the new keyword) returns a string representation of the current date and time, exactly as new Date().toString() does.

How does date value work in Excel? ›

The DATEVALUE function is helpful in cases where a worksheet contains dates in a text format that you want to filter, sort, or format as dates, or use in date calculations. To view a date serial number as a date, you must apply a date format to the cell.

How do I write dates in Microsoft Access? ›

Access automatically displays the date and time in the General Date and Long Time formats. The dates appear as, mm/dd/yyyy in the U.S. and as, dd/mm/yyyy outside the U.S. where mm is the month, dd is the day, and yyyy is the year.

How do I enable date in Excel? ›

Ctrl + ; shortcut inserts the today date in a cell. Ctrl + Shift + ; shortcut inserts the current time. To enter the current date and time, press Ctrl + ; then press the Space key, and then Ctrl + Shift + ;.

How do I use the date if function in Excel? ›

How to Use DATEDIF Excel Function? (With Steps)
  1. Open Excel. Open your Excel workbook where you want to use the DATEDIF function.
  2. Enter Your Dates. Enter the start date and end date in two separate cells. ...
  3. Select the Cell for the Result. ...
  4. Enter the DATEDIF Formula. ...
  5. Choose the Unit.
May 14, 2024

How do I get Excel to automatically calculate dates? ›

Here is a list of steps to help you use this tool with the "Formulas" tab:
  1. Select a cell and then click on the "Formulas" tab.
  2. Click "Date and time" on the ribbon.
  3. Select "TODAY" from the drop-down menu.
  4. Click "Ok" in the "Function arguments" dialog box. The current date now appears in the selected cell.
Jun 24, 2022

What is the function of date? ›

Dates include a variety of functional and bioactive substances such as carotenoids, anthocyanins, phenolics, antioxidants, and dietary fiber, all of which have anti-tumor, anti-ulcer, anti-microbial, and immuno-modulatory characteristics. Furthermore, dates are regarded as a nutraceutical and functional food.

What is Microsoft date format? ›

The dates appear as, mm/dd/yyyy in the U.S. and as, dd/mm/yyyy outside the U.S. where mm is the month, dd is the day, and yyyy is the year. The time is displayed as, hh:mm:ss AM/PM, where hh is the hour, mm is minutes, and ss is seconds.

What is date command in Windows? ›

Displays or sets the system date. If used without parameters, date displays the current system date setting and prompts you to enter a new date. Important. You must be an administrator to use this command.

Top Articles
3 Highest Paying Industries For 2024, According To Research
How honey bees may one day help detect signs of cancers
Mcfarland Usa 123Movies
Cad Calls Meriden Ct
Southside Grill Schuylkill Haven Pa
Craigslist Parsippany Nj Rooms For Rent
According To The Wall Street Journal Weegy
Merlot Aero Crew Portal
Walgreens Alma School And Dynamite
About Goodwill – Goodwill NY/NJ
Declan Mining Co Coupon
Www.paystubportal.com/7-11 Login
Purple Crip Strain Leafly
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Fool’s Paradise movie review (2023) | Roger Ebert
"Une héroïne" : les funérailles de Rebecca Cheptegei, athlète olympique immolée par son compagnon | TF1 INFO
Craigslist Toy Hauler For Sale By Owner
Lcwc 911 Live Incident List Live Status
Stardew Expanded Wiki
Traveling Merchants Tack Diablo 4
Poe Str Stacking
Sea To Dallas Google Flights
The Tower and Major Arcana Tarot Combinations: What They Mean - Eclectic Witchcraft
Craigslist Houses For Rent In Milan Tennessee
Haunted Mansion Showtimes Near Epic Theatres Of West Volusia
FAQ's - KidCheck
Copper Pint Chaska
Mjc Financial Aid Phone Number
Vivification Harry Potter
How often should you visit your Barber?
Dailymotion
2015 Chevrolet Silverado 1500 for sale - Houston, TX - craigslist
Audi Q3 | 2023 - 2024 | De Waal Autogroep
Ticketmaster Lion King Chicago
Collier Urgent Care Park Shore
How are you feeling? Vocabulary & expressions to answer this common question!
Main Street Station Coshocton Menu
Scarlet Maiden F95Zone
Acts 16 Nkjv
Guy Ritchie's The Covenant Showtimes Near Grand Theatres - Bismarck
Exam With A Social Studies Section Crossword
Pathfinder Wrath Of The Righteous Tiefling Traitor
Toomics - Die unendliche Welt der Comics online
Patricia And Aaron Toro
Noga Funeral Home Obituaries
The Blackening Showtimes Near Ncg Cinema - Grand Blanc Trillium
A jovem que batizou lei após ser sequestrada por 'amigo virtual'
Michaelangelo's Monkey Junction
Zadruga Elita 7 Live - Zadruga Elita 8 Uživo HD Emitirani Sat Putem Interneta
Renfield Showtimes Near Regal The Loop & Rpx
Vt Craiglist
Guidance | GreenStar™ 3 2630 Display
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 5988

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.