Hello,
I have a requirement where i need a formula that would take a date(DOB) see if only the month and date is less than current date if yes then change the date with same month and date but year would be next year so + 365 days. If date and month are more than current date and month then year would be current year.
Eg:
1. Date is 01.01.1999 then resultant date should be 01.01.2021 since 1st Jan is less than current date and month.
2. Date is 01.11.1999 then resultant date would be 01.11.2020 since 1st Nov is greater than todays date and month.
I am using a variable(DOB) in vba to store the date. This is a date type variable.
It is being read from an excel file.
Any short way of doing this vs creating an entire script?
I have a requirement where i need a formula that would take a date(DOB) see if only the month and date is less than current date if yes then change the date with same month and date but year would be next year so + 365 days. If date and month are more than current date and month then year would be current year.
Eg:
1. Date is 01.01.1999 then resultant date should be 01.01.2021 since 1st Jan is less than current date and month.
2. Date is 01.11.1999 then resultant date would be 01.11.2020 since 1st Nov is greater than todays date and month.
I am using a variable(DOB) in vba to store the date. This is a date type variable.
It is being read from an excel file.
Any short way of doing this vs creating an entire script?