Search code examples
google-sheetsgoogle-sheets-formulagoogle-finance

How do I calculate the monthly income when taking into account 1 time but also payment in 3 installments


I have a situation where I am receiving payments. There are 2 types of payments 1. Payment in full and 2. Payment in 1-2-3-4 installements.

Here you can find an Example sheet of data. I only have the first payments of the installments so for example if you have 4 installments and the amount next to it is 125,00 EUR. It will mean, the customer has to pay 125,00 EUR this month, next month and the 2 months after that.

I am wondering, how do I calculate the amount of money I will receive each month?

What I have tried so far:

I have tried using =IF formula's and using QUERY to filter by date and then only taking those amounts, but for some reason it keeps on taking the wrong amount.

Any help would be greatly appreciated!


Solution

  • Added formula to to your sheet. Please do test it out:

    =index(let(a,query(REDUCE({"",""},sequence(counta(A2:A)),lambda(a,c,{a;eomonth(edate(index(A2:A,c),sequence(index(B2:B,c),1,0,1)),),if(sequence(index(B2:B,c)),index(C2:C,c))})),"Select Col1, sum(Col2) Where Col1 is not null group by Col1 label sum(Col2) ''"),transpose({text(index(a,,1),"MMMM"),index(a,,2)})))
    

    enter image description here