ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   subtract dates (https://www.excelbanter.com/excel-programming/293434-subtract-dates.html)

jrh

subtract dates
 
Hi. I need to do an if then formula that applies a
formula if two dates are within 9 months of each other or
does not apply the formula if they are 9 months or greater
apart. How do I do this? I can't just base it off of a
straight # of days X 9 because of the different days in a
month.

Thank you.

Frank Kabel

subtract dates
 
Hi
try (if A1 and A2 stores your dates)
=IF(OR(DATEDIF(A1,A2,"m")<9,AND(DATEDIF(A1,A2,"m") =9,DATEDIF(A1,A2,"md"
)=0)),your_formula,"")

--
Regards
Frank Kabel
Frankfurt, Germany

jrh wrote:
Hi. I need to do an if then formula that applies a
formula if two dates are within 9 months of each other or
does not apply the formula if they are 9 months or greater
apart. How do I do this? I can't just base it off of a
straight # of days X 9 because of the different days in a
month.

Thank you.




All times are GMT +1. The time now is 03:47 AM.

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