Posted by admin on

Date Differences in Excel

I was looking to calculate if someone was under 27 years old; this can Be quite tricky but excel has just the function, =DATEDIF().
=DATEDIF(B3,DATE(YEAR(NOW()),MONTH(NOW()),DAY(NOW())),"y")
returns the number of years between NOW and date held in cell B3. (It handles all the year rounding and leap years so there’s no need to worry about rounding etc.
IF(DATEDIF(B3,DATE(YEAR(NOW()),MONTH(NOW()),DAY(NOW())),"y")>25,1,0)
will return true (1) or false (0) depending on if the difference between the dates is greater than 25 years of not.
I used the www.cpearson,com site as my guide.


This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close