I'm having difficulty trying to tally the number of regular payments - both those that have already happened and those that are scheduled to happen - between two specified dates. Here is the general setup of inputs:
B1: Interval Start Date
B2: Interval End Date
B3: First Payment Date
B4: Next Scheduled Payment Date
B5: Payment Frequency (monthly, quarterly, semi-annually, or annual)
The payments occur at regular intervals according to one of the four possible frequencies, but the interval between the two dates can be any duration. Essentially this means I'm counting certain dates inside the interval. I don't have an entire column with each payment date, so I'm not sure how a COUNT function would work.
I was able to solve this problem for the monthly frequency by using an array formula based on the day of the month as follows:
B7 = # of monthly payments within interval =SUMPRODUCT(--(DAY(ROW(INDIRECT(B1&":"&B2)))=DAY(B3)))
As an admitted Excel novice, I'm struggling to translate this same formula to cover the quarterly, semi-annual, and annual frequencies. I've tried using some clumsy AND/OR logic to account for which months and days should be counted, but I keep tripping over errors.
If an example helps illustrate what I'm after, use these values:
B1: 12/10/2011
B2: 8/1/2012
B3: 6/15/2010
B4: 6/15/2012
If B5 = Monthly, B7 = 8 (12/15, 1/15, 2/15, 3/15, 4/15, 5/15, 6/15, 7/15)
If B5 = Quarterly, B7 = 3 (12/15, 3/15, 6/15)
If B5 = Semi-Annual, B7 = 2 (12/15, 6/15)
If B5 = Annual, B7 = 1 (6/15)
Any help would be much appreciated.
intervalcount.xls
Bookmarks