You can use cell reference to store the number of days, months, or years you want to add or subtract, and then incorporate these references into your formulas.
How to create a formula to subtract or add a dynamic number of days, months, or years to a date? The syntax is: ‘=DATEDIF(start_date,end_date,”m”) for months and ‘=DATEDIF(start_date, end_date,”y”)’ for years. You can use DATEDIF function to find the difference in months or years between two dates. How to subtract dates to find the difference in months or years? For example, if A2 consists the start date then B2 consists the end date, the formula would be : ‘B2-A2’. To Calculate the difference in days between two dates, simply subtract the earlier date from the later date.