Javatpoint Logo
Javatpoint Logo

Excel Date Function in Microsoft Excel

Introduction to DATE Function in Microsoft Excel

In Microsoft Excel, the date function is very helpful for the purpose of creating the dates while considering the Month, Year, and the Day. And we can type any particular number and the Date function will then able create the date with respect to the value or the number which we have provided in the sheet.

Besides all this, the particular function is very helpful and they are much useful for the purpose of structuring out the date standards when we are incorporated with the multiple dates in multiple formats as well.

What do you understand by the term DATE Function in Microsoft Excel?

The DATE Function in Microsoft Excel is categorized under the Excel Date/Time Function, which is the main function usually used to calculate the dates in Microsoft Excel.

And the particular DATE function is very useful for the financial analysts it is because the financial modeling requires specific time periods.

  • For example, a particular analyst will effectively make use of the DATE function in Microsoft Excel in their financial model for the purpose of dynamically linking of the Year, Month, as well as the Day from the different cells into one function effectively.
  • And the DATE function is much useful while providing the dates as the inputs for the other functions, and that can include: SUMIFS or COUNTIFS since we can easily assemble a date with the help of the Year, month, as well as the day values which come from a cell reference.

Step 1: First of all, we will enter the number that is 43434, in the Microsoft Excel sheet and after that we will define the format for the date we want: DD-MM-YYY.

Excel Date Function in Microsoft Excel

Step 2: And once we mentioned the respective format, then we will be looking at how excel will shows up the given number in the used cell.

Excel Date Function in Microsoft Excel

Step 3: Now, after that we will give the format as [hh]: mm: ss, and then it will display the result as:

Excel Date Function in Microsoft Excel

Microsoft Excel is working on the different integers (numbers) and their formats.

And by making use of the DATE Function in Excel, one can easily create an accurate date.

  • For example, =DATE (2023, 01, 10) would give the result as 10-01-2023.

DATE Formula in Microsoft Excel

The Formula for the DATE Function, which is extensively used in Microsoft Excel, is as follows:

Formula:

The above Formula of the DATE function includes 3 arguments, which are as follows:

Year, Month, as well as the Day.

  1. Year: Year is one of the required arguments in Microsoft Excel; and the value which is associated with the year argument can primarily include 1 to 4 digits.
    Syntax:
    Excel Date Function in Microsoft Excel
  2. Month: Month is primarily termed to be the essential parameter in the given DATE Function. And if in case the month parameter would be a 2-digit number that could be supplied directly to the cell reference.
    Syntax:
    Excel Date Function in Microsoft Excel
    • In Microsoft Excel one can easily add the number of the months to the starting month of the specified Year. For example, DATE (2019, 13, 1) that will be returning the serial number showing January 1, 2019.
  3. Day: it is an essential argument in the DATE function which can be either a positive or a negative integer that is representing the Day of a month from 1 to 31.
    Syntax:
    Excel Date Function in Microsoft Excel

How an individual can make use of the DATE Function in Microsoft Excel?

The respective DATE Function in Microsoft Excel is a simple and easy-to-use functionality for any individual. So, let us now see how to make use of the DATE Function in Microsoft Excel with the help of the various examples effectively.

# Example: 1 Use of the DATE Function

From the below-mentioned data, we can efficiently create full date values. As in the first column, we have days; we have Month mentioned in the second column, whereas we can have Year and in the third column respectively. We will combine all the three in a single one:

Excel Date Function in Microsoft Excel

Now we will be then entering out the above data into an excel sheet by apply the below Formula to get the full date value.

Formula:

Excel Date Function in Microsoft Excel

And after entering the above Formula in the respective cell, we will get the Full Date as in the form of the output.

Excel Date Function in Microsoft Excel

# Example: 2 How to find the difference between the two days in terms of Total Years, Total Months, as well as the Days

To find out the difference between the two days in terms of Total Years, Total Months, and Total Days, we will be using the DATEIF Function.

  • For example, let us assume that we are working in an HR department in a particular company and have an employee joining date and their relieving date data efficiently. Nextly, we need to find out the total tenure in the company, like 4 Years, 5 Months, and 12 Days.
Excel Date Function in Microsoft Excel

Here in the figure mentioned above, we will be making use of the DATEDIF function in order to get the result in accordance to our choice. And the DATE function alone cannot do the job for us. So if, in case, we deduct the relieving date from the joining date, then we can get the only number of days the particular employee has worked; we bring in detail respectively:

Excel Date Function in Microsoft Excel

And to get the full outcome, i.e. Total Tenure, we are needed to make use of the DATEDIF function.

Excel Date Function in Microsoft Excel

And we know that the: DATEDIF function is an undocumented formula for which there is no IntelliSense list.

Excel Date Function in Microsoft Excel

Now it can be seen that the given Formula primarily looks lengthy. So we can effectively break it down to get the detailed description of it:

  1. Part 1: =DATEDIF (B2, C2, "Y") is termed to be the starting date as well as the ending date, while "Y" means we need to know the difference between the given years.
  2. Part 2: &" Year" this part is just added to a previous part of the foSo, forla.
    • For example, if the first part gives us 4, the result will be 4 years effectively.
  3. Part 3: &DATEDIF (B2, C2, "YM") Now, we can find the difference between the years. And in this part of the Formula, we will be just finding the difference between the given months. And the "YM" primarily can give the difference between the months.
  4. Part 4: &" Months" This would be considered to be the additional to part of 3. If the result of part 3 is 4, then this part will be adding the Months to part 3.
  5. Part 5: "&DATEDIF (B2, C2," MD") now we will be having a difference between Year as well as the Month, whereas in this part, we are finding the difference between the days. "MD" can give us that difference effectively.
  6. Part 6: &" Days" is just added into the part 5. And if in case the result from part 5 is 25, as it will be adding the Days to it.
Excel Date Function in Microsoft Excel

# Example: 3

Now in this example, we will explain the different date formats available in Microsoft excel. There are many date formats in Microsoft excel, and each of them will shows up the result.

Excel Date Function in Microsoft Excel

VBA (Virtual Basic for Application) Example with Date in Microsoft Excel:

Let us assume that we are in the company's welfare team and in that we need to send birthday emails to our respective employees if there are any birthdays. However, sending wishes to every employee is bit a toughest job. So to overcome this, we can develop a code in order to auto-send the birthday wishes to each and every employee whose birthday is coming.

This data will show the employee name and their date of birth:

Excel Date Function in Microsoft Excel

And in these, we have written a code for the purpose of sending the birthday emails to everyone on their birthday.

Excel Date Function in Microsoft Excel

Once the code is written on the VBA module, we will save the workbook.

And it is needed to add our data to the excel sheet and then run the code every morning coming to the office.

What are the important that needs to be remembered by an individual in Excel?

The important thing that needs to be remembered by an individual in Microsoft Excel while working with the Date Function is as follows:

  • An individual must take care that the given number must be >0 and <10000; if not, then Microsoft Excel will show the error as #NUM!.
  • And an individual can supply only numerical values, and if not, then the individual will encounter the error that #VALUE ERROR.
  • Microsoft Excel stores the date in the serial number form and will also show the display in accordance with the given format.
  • An individual always needs to enter a full-year value, and they are not supposed to enter any shortcut keys such as 17, 18, 19, etc., so instead of that, an individual can proceed further by typing out the full year like 2016 or 2018.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA