The start and end dates must be real date specifications. You can either enter the time directly in the function using the DATE function or use a cell reference. The cell in which you enter the specific day must be formatted as a date. The end date must follow the start date chronologically. The resulting unit is specified as text. It must be entered in quotes within the function. However, you can refer to another cell in this parameter. You have six different options for this parameter.
- Y: Years
- M: Months
- D: Days
- YM: Difference between the months. Years and days are ignored.
- MD: Difference between the days. Months and years are ignored.
- YD: Difference between the days and months. Years are ignored.
The differences between the various units are best explained using an example. We want to calculate the difference between 1/1/2019 and 2/2/2020.
- Y: 1
- M: 13
- D: 397
- YM: 1
- MD: 1
- YD: 32