ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Programming (https://www.excelbanter.com/excel-programming/279087-re-date-programming.html)

Dan E[_2_]

Date Programming
 
Mark,

To calculate the Years
=IF(DAY(A1)<15,DATEDIF(DATE(YEAR(A1),MONTH(A1),1), B1,"Y"),DATEDIF(DATE(YEAR(A1),MONTH(A1)+1,1),B1,"Y "))

To calculate the Months
=IF(DAY(A1)<15,DATEDIF(DATE(YEAR(A1),MONTH(A1),1), B1,"YM"),DATEDIF(DATE(YEAR(A1),MONTH(A1)+1,1),B1," YM"))

Dan E

"Mark" wrote in message ...
Hi,

I've been asked to create a spreadsheet which creates a
date calculation for two sets of dates (birthdate, benefit
eligibility date). However, there is some criteria that
needs to be met:

1. If the person is born on the 15th of the month or
earlier, than the member is a month older (except if born
on the 1st, that date would be treated normally).

2. If the person is born on the 16th of the month or
later, then that month doesn't count.

Example 1:

DOB: Jan. 8/46, Date Eligible: Feb. 1/04
This person would be 58 years and 1 month old (because
birthdate is before Jan. 16th)

IF, the "Date Eligible" was Jan. 1/04, then the person
would be 58 years old.


Example 2:

DOB: Jan. 16/46, Date Eligible: Feb. 1/04
This person would be 58 years old (because birthdate is
after Jan. 16th)


If anyone can help me with this I would really appreciate
it.

Thanks,

Mark






All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com