Excel date function - Usage and examples

The date counting function in Excel is one of the most effective functions of this software. Because Excel usually works in the field of statistics and calculations, it is extremely necessary to record dates. To help you understand this function, let's come to the following article of TipsMake.

The date counting function in Excel is one of the most effective functions of this software. Because Excel usually works in the field of statistics and calculations, it is extremely necessary to record dates. To help you understand this function, let's come to the following article of TipsMake .

Excel date function - Usage and examples Picture 1Excel date function - Usage and examples Picture 1

1. Functions of the function

DATEDIF is a function used to count dates used in Excel. The DATEDIF function is used to calculate dates in 6 different ways but perhaps the most common people use only three of them.

The use of DATEDIF is exactly the same as the title of this trick, it is used to count the number of days, months or years with two available timelines.

The application of this function will be used to calculate the time to time when going to work or used to calculate ancillary to the service charged by date. Like the example below, the hotel cashier on business trips is summarized by the accountant. They charge a daily accommodation fee, so the number of days will be equal to the date of departure from the hotel minus the date of arrival at the hotel.

Excel date function - Usage and examples Picture 2Excel date function - Usage and examples Picture 2

2. Usage of the function

Recipe:

= DATEDIF (start time; end time; calculation type)

Inside:

The start time is the start date of the time series to be counted.

The end time is the end date of the time series to be counted.

The calculation type is the calculation type based on the criteria we set for Excel to confirm what you need to calculate from the other two time points. There are 6 types to calculate all:

- "D" is used when you want to calculate the number of days between a start and an end.

- "M" is used when you want to calculate the number of months between the start and end time.

- "Y" is used when you want to calculate the number of years between the beginning and the end.

Above are the three most common types of calculations when you use DATEDIF, but in addition it also provides three other special types:

- "YD" to find the number of days between the start date and end date, regardless of the number of years and the number of months.

- "YM" to find the number of months between the start date and end date, regardless of the number of years and days.

- "YD" to find the number of days between the start date and end date regardless of the number of years.

Note: The type of calculation you need to put in quotation marks as written above, if only written lowercase, the function will not understand the command you give.

3. Function example

To help you understand the DATEDIF function more, let's come up with the following examples:

We calculate students' age through their year of birth. Normally when calculating the age, we will subtract the current year from the year of birth, that is, the number of years existing between the time you were born and the present time.

So here it is very appropriate to use the DATEDIF function.

We have a formula based on the example table in the image as follows:

= DATEDIF (C2; TODAY (); "Y")

Excel date function - Usage and examples Picture 3Excel date function - Usage and examples Picture 3

With the TODAY () function is the function that gives the date value at the time of using the function, ie today. Combined with the DATEDIF function, we can calculate the age of the students in the list.

Excel date function - Usage and examples Picture 4Excel date function - Usage and examples Picture 4

There is also an example that uses the DATEDIF function to calculate the number of days from one time to another based on which to calculate the amount of money you need to use the service in units of time.

The formula here is:

= DATEDIF (D3; E3; "D")

Excel date function - Usage and examples Picture 5Excel date function - Usage and examples Picture 5

Thank you for following the article on Excel's date counting function and how to use the date counting function of TipsMake.com . Wish you can master the date counting function into practical applications.

4.5 ★ | 2 Vote