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 .

Excel 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 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 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 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 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

May be interested

  • DSUM function in Excel, how to use DSUM function and examplesDSUM function in Excel, how to use DSUM function and examples
    dsum function in excel, how to use dsum function and examples. the dsum function in excel is a fairly common function with a fairly simple usage. but if you do not know how to use the dsum function, you can refer to the following article to understand h
  • How to use the MAXA function in Excel, detailed examplesHow to use the MAXA function in Excel, detailed examples
    the maxa function in excel helps find the largest value in a data set, including numbers, logical values, and text containing numbers. this is different from the max function, which only counts numbers. let's learn the syntax and usage of the maxa function with practical examples.
  • How to use the SUMIF function in ExcelHow to use the SUMIF function in Excel
    the sumif function in excel is a function used to compute values ​​in a specified range. the sumif function can be used for summing cells based on the date, data and text that are connected to the specified area.
  • RANK function - Rank function in Excel - Usage and examplesRANK function - Rank function in Excel - Usage and examples
    the rank function arranges equal numbers of the same rank. however, the duplication will affect the ranking of subsequent numbers. for example, you have the sequence number: 1,2,2,3,4 and are arranged in ascending order, so the order of the number 1 in the series is 5.
  • DCount function in Excel - How to use the DCount function and examples using the DCount functionDCount function in Excel - How to use the DCount function and examples using the DCount function
    dcount function in excel - how to use the dcount function and examples using the dcount function you have a large list of students who want to get a high total score, but don't want to spend a lot of time. in this article, introduce to you the dcount function in excel. help c
  • The search function satisfies many conditions in Excel - Usage and examplesThe search function satisfies many conditions in Excel - Usage and examples
    the search function satisfies many conditions in excel - usage and examples. in the process of processing data in excel many times you need to search for data that satisfies many conditions to extract data, so you are looking for a function that satisfies many things.
  • INDIRECT function in Excel - How to use INDIRECT function and examples using INDIRECT functionINDIRECT function in Excel - How to use INDIRECT function and examples using INDIRECT function
    indirect function in excel - how to use indirect function and examples using indirect function. you want to refer to a range of data without changing the formula in the cell. the following article introduces you to the indirect function in excel to help you reference
  • DATE function - The date function in ExcelDATE function - The date function in Excel
    the date () function returns a date that is formatted corresponding to the date entered as based on the date index.
  • Multiple if function - Usage and examplesMultiple if function - Usage and examples
    the following article gives you a detailed guide on how to use the multiple if function with examples. the if function is simplified in the sense that the function tests a value with a given condition, if it satisfies the condition that returns 1 value, if it does not satisfy the condition.
  • SUM function in Excel, sum function and examplesSUM function in Excel, sum function and examples
    sum is a basic excel function that allows users to quickly and accurately calculate the sum of columns or cells in an excel spreadsheet. for an overview of the concept, formula and how to use the sum function in excel, readers can refer to our article below. with many illustrative examples from simple to complex, readers can understand and quickly apply this function to practical work.