Spreadsheet: 67408d1268056072-if-dates-return-value-if-dates-return-value-rev3
Sheet: Sheet1

 | SCENARIO 1:  From start then every N days as per cell C4 the amount will be posted and zero to the last date if not up to N days as per C4.
 | AMOUNT: | 34000
 | DAYS: | 90
 | [NAME] | START | FINISH | 2010-01-31 00:00:00 | 2010-02-28 00:00:00 | 2010-03-31 00:00:00 | 2010-04-30 00:00:00 | 2010-05-31 00:00:00 | 2010-06-30 00:00:00 | 2010-07-31 00:00:00 | 2010-08-31 00:00:00 | 2010-09-30 00:00:00 | 2010-10-31 00:00:00 | 2010-11-30 00:00:00 | 2010-12-31 00:00:00 | 2011-01-31 00:00:00 | 2011-02-28 00:00:00 | 2011-03-31 00:00:00 | 2011-04-30 00:00:00 | 2011-05-31 00:00:00 | 2011-06-30 00:00:00 | 2011-07-31 00:00:00 | 2011-08-31 00:00:00 | 2011-09-30 00:00:00 | 2011-10-31 00:00:00 | 2011-11-30 00:00:00 | 2011-12-31 00:00:00
 | International Ticket | 2010-01-01 00:00:00 | 2011-01-25 00:00:00 | 34000 | 0 | 0 | 34000 | 0 | 34000 | 0 | 0 | 34000 | 0 | 0 | 34000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 | Should be in row 7 |  |  | 34000 |  | 34000 | 0 | 0 | 34000 | 0 | 0 | 34000 |  |  | 34000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  |  | 31 | 28 | 31 | 30 | 31 | 30 | 31 | 31 | 30 | 31 | 30 | 31 | 31 | 28 | 31
 |  |  |  |  |  | 0 | 30 | 31 | 30
 |  | 2010-01-01 00:00:00 | 2010-03-31 00:00:00 | 90 |  |  |  |  | 1 | 31 | 31 | 30
 |  |  |  |  |  |  |  |  |  |  |  | 3 | 31 | 30 | 31
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 5 | 25
 | SCENARIO 1:  From start then every N days as per cell C4 the amount will be posted and zero to the last date if not up to N days as per C17.
 | AMOUNT: | 34000
 | DAYS: | 42
 | [NAME] | START | FINISH | 2010-01-31 00:00:00 | 2010-02-28 00:00:00 | 2010-03-31 00:00:00 | 2010-04-30 00:00:00 | 2010-05-31 00:00:00 | 2010-06-30 00:00:00 | 2010-07-31 00:00:00 | 2010-08-31 00:00:00 | 2010-09-30 00:00:00 | 2010-10-31 00:00:00 | 2010-11-30 00:00:00 | 2010-12-31 00:00:00 | 2011-01-31 00:00:00 | 2011-02-28 00:00:00 | 2011-03-31 00:00:00 | 2011-04-30 00:00:00 | 2011-05-31 00:00:00 | 2011-06-30 00:00:00 | 2011-07-31 00:00:00 | 2011-08-31 00:00:00 | 2011-09-30 00:00:00 | 2011-10-31 00:00:00 | 2011-11-30 00:00:00 | 2011-12-31 00:00:00
 | International Ticket | 2010-01-01 00:00:00 | 2011-02-01 00:00:00 | 34000 | 34000 | 34000 | 0 | 34000 | 34000 | 34000 | 0 | 34000 | 34000 | 0 | 34000 | 34000 | 34000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 | Should be in row 7 |  |  | 34000 | 34000 | 34000 | 0 | 34000 | 34000 | 34000 | 0 | 34000 | 34000 |  | 34000 | 34000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  |  | 31 | 28 | 31 | 30 | 31 | 30 | 31 | 31 | 30 | 31 | 30 | 31 | 31 | 28 | 31 | 30 | 31 | 30 | 31 | 31 | 30 | 31 | 30 | 31
 |  |  |  |  | 17 | 31
 |  |  |  |  |  | 6 | 30 | 31
 |  |  |  |  |  |  |  | 25 | 30
 |  |  |  |  |  |  |  |  | 13 | 31 |  |  |  |  |  |  |  | 19 days only so should be zero.
 |  |  |  |  |  |  |  |  |  | 2 | 31 | 30
 |  |  |  |  |  |  |  |  |  |  |  | 21 | 31
 |  |  |  |  |  |  |  |  |  |  |  |  | 10 | 30 | 31
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 29 | 31
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 18 | 1
 | SCENARIO 2:  From start then every N days as per cell c18 the amount will be posted and also if there is any balance to the last date even if it is not up to N days (C35).
 | AMOUNT: | 34000
 | DAYS: | 90
 | [NAME] | START | FINISH | 2010-01-31 00:00:00 | 2010-02-28 00:00:00 | 2010-03-31 00:00:00 | 2010-04-30 00:00:00 | 2010-05-31 00:00:00 | 2010-06-30 00:00:00 | 2010-07-31 00:00:00 | 2010-08-31 00:00:00 | 2010-09-30 00:00:00 | 2010-10-31 00:00:00 | 2010-11-30 00:00:00 | 2010-12-31 00:00:00 | 2011-01-31 00:00:00 | 2011-02-28 00:00:00 | 2011-03-31 00:00:00 | 2011-04-30 00:00:00 | 2011-05-31 00:00:00 | 2011-06-30 00:00:00 | 2011-07-31 00:00:00 | 2011-08-31 00:00:00 | 2011-09-30 00:00:00 | 2011-10-31 00:00:00 | 2011-11-30 00:00:00 | 2011-12-31 00:00:00
 | International Ticket | 2010-01-01 00:00:00 | 2011-02-05 00:00:00 | 34000 | 0 | 0 | 34000 | 0 | 34000 | 0 | 0 | 34000 | 0 | 0 | 34000 | 0 | 34000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 | Should be in row 18 |  |  | 34000 |  | 34000 | 0 | 0 | 34000 |  | 0 | 34000 |  |  | 34000 |  | 34000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 |  |  |  | 31 | 28 | 31 | 30 | 31 | 30 | 31 | 31 | 30 | 31 | 30 | 31 | 31 | 28
 |  |  |  |  |  | 0 | 30 | 31 | 30
 |  |  |  |  |  |  |  |  | 1 | 31 | 31 | 30
 |  |  |  |  |  |  |  |  |  |  |  | 3 | 31 | 30 | 31
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 5 | 31 | 28