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

Technical details

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:

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 example 1

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 Example 2

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.

Change the date format

  1. Right-click the cell(s) you want to change. On a Mac, Ctrl-click the cells.
  2. On the Home tab click Format > Format Cells or press Ctrl+1 (Command+1 on a Mac).
  3. 3. Choose the Locale (location) and Date format you want.
  4. For more information on formatting dates, see Format a date the way you want.Format a cell as a date

Calculate a date based on another date

You can use the DATE function to create a date that is based on another cell’s date. For example, you can use the YEARMONTH, 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:

Calculate a date based on another date
  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.

Convert text strings and numbers into dates

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 LEFTMID, and RIGHT functions.

Convert text strings and numbers into dates
  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.

Increase or decrease a date by a certain number of days

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 days (the value in C5).Increase or decrease a date by a certain number of days

Leave a Reply

Your email address will not be published. Required fields are marked *

Open chat
1
ভর্তি/সার্টিফিকেট তথ্য জানতে ক্লিক করুন
Scan the code
আস সালামু আলাইকুম। বিস্তারিত জানতে/ কল করতে ক্লিক করুন Open Chat বাটনে