Here is something tricky I am trying to implement without VBA if possible.
So I have 2 dates and a number of months.
Ex
D1 = 4/1/2006
D2 = 5/1/2009
Months = 18
Here is the algorithm in english:
Do until D1>=D2:
1. Add Number of months to D1
2. After that, keep incrementing D1 by a year
So running through the example:
Step 1 : Get D1 - 4/1/2006
2: Add Months to it - 4/1/2006 + 18 months = 10/1/2007
3: Test 10/1/2007 >= 5/1/2009 = False.
4: Add 1 year onto 10/1/2007 = 10/1/2008
5. Still not >= 5/1/2009
6. Add another year = 10/1/2009
7. Now it bigger so return 10/1/2009
From an efficiency standpoint, keep in mind calc needs to run on > 300k rows
So I have 2 dates and a number of months.
Ex
D1 = 4/1/2006
D2 = 5/1/2009
Months = 18
Here is the algorithm in english:
Do until D1>=D2:
1. Add Number of months to D1
2. After that, keep incrementing D1 by a year
So running through the example:
Step 1 : Get D1 - 4/1/2006
2: Add Months to it - 4/1/2006 + 18 months = 10/1/2007
3: Test 10/1/2007 >= 5/1/2009 = False.
4: Add 1 year onto 10/1/2007 = 10/1/2008
5. Still not >= 5/1/2009
6. Add another year = 10/1/2009
7. Now it bigger so return 10/1/2009
From an efficiency standpoint, keep in mind calc needs to run on > 300k rows