Hi I need to calculate installments between two dates.

Suppose A1 contains 10/01/2008 and B1 contains 08/10/2008

I want, firstly, in C1 to calculate monthly installments between the two. The answer i need to return is 9 because we take A1 to mean it's the first installment (so the 10th of each month is the due date) and October 10 falls after the second date (the 8th of October). So the customer needs to have paid his bill in full from January to September.

in C2 I need the number of fortnightly installments using the same logic

and in C3 the same again but weekly installments.

In the latter two instances the deciding factor is the weekday. So if Jan 10 was a thursday and October 8 were a wednesday, then the final installment would have to be whichever thursday was before the closing date.

I'm getting annoyed with this one so if you could help that would be fab.