Really struggling with this one, I have a monthly cash flow which is fine for the rest of the workbook.

My mortgage payments are at the begging on each month (there are some other rules which I need to include in a fairly complex if statement.

Is there anyway (see attached) to create a code so does as desired automatically?Example.xlsx