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 .
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.
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")
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.
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")
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.
You should read it
- Offset function in Excel - Usage and examples
- IRR function in Excel - Usage and examples
- Function Address - The function returns the address of a cell in Excel (usage, examples, examples)
- OR function in Excel, how to use the OR function, and examples
- PMT function in Excel - Usage and examples
- DCOUNT function in Excel - Usage and practical examples
- FIND function in Excel - Usage and examples
- Match function in Excel - Usage and illustrative examples
- VLOOKUP function to use and specific examples
- ROUNDUP function in Excel - Usage and examples
- DSUM function in Excel, how to use DSUM function and examples
- How to use the SUMIF function in Excel
Maybe you are interested
How to turn a photo into a painting using the Generative Fill function in Photoshop
How to use the TREND function in Excel
Google Sheets Functions to Simplify Your Budget Spreadsheets
Instructions for using the TRIMRANGE function to clean up Excel tables
How to master numerical data in Google Sheets with the AVERAGE function
Don't buy headphones if they lack this important function!