Monday, January 25, 2021

Excel - Date functions

I am going to explain Microsoft Excel Date funtions in the below article. Microsoft Excel provides a bunch of Date functions to work with dates and times values. Here I am going to explain most of the time we use to calculate Age, Date formats and difference between two days with the samples.

TEXT Funtion
The TEXT function uses to convert dates to a text string.
Syntax : TEXT(value, format_text)
With the syntax of TEXT(value, format_text) function, we can change the dates to text strings in a variety of formats. Some sample formats are as explained in the following below screenshot.



DATEDIF Funtions

DATEDIF function is used to calculate the difference between two dates in days, months or years.
Syntax : DATEDIF(start_date, end_date, unit)
We have to provide the Unit argument as d, m or y to retun the no of days, months or years. Below I have provided the sample and also the same explained in the screen shot.

=DATEDIF(C2, TODAY(), "d") - This will calculates the number of days between the cell value in C2 and today's date.
=DATEDIF(C2, TODAY(), "m") - This will returns the number of complete months between the dates in C2 and today's date.
=DATEDIF(C2, TODAY(), "y") - This will returns the number of complete years between the dates in C2 and today's date.



Calculating the difference between two dates columns are explained in the below screen shot. The screen shot showing is no of years differrence in the two days. If you want no of days between the two days you have to give unit section as d instedad of y in quotation marks.


You can also view the same in the below you tube link
https://www.youtube.com/watch?v=KS-GiSNV7cY

No comments: