Question

I have an Excel sheet where someone types in the date for a yearly bill. I need to know how many times we need to pay that bill between 2 dates.

For example if a bill is due every year on May 31st, the user will type in 5/31/2014. I need to know how many time we will pay that bill between 5/15/2014 and 5/15/2018. (The between dates will change). I can't just take the number of years between the start and end dates because in the example above the start and end dates could be 6/1/2014 and 5/30/2018, in which case I only have to pay the bill in 2015, 2016, and 2017, which makes 3 times.

I have this formula which calculates the number of times a certain day occurs between 2 dates: SUMPRODUCT(--(DAY(ROW(INDIRECT($Q$2&":"&$R$2)))=F4))(Q2 is the begin date, R2 is the end date, and F4 has the day of the month) But I can't figure out how to get this to work for a month and day.

Was it helpful?

Solution

Assuming the specific date in G4 you can use this version

=SUMPRODUCT(--(TEXT(ROW(INDIRECT($Q$2&":"&$R$2)),"ddmmm")=TEXT(G4,"ddmmm")))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top