如果同一行上的两个值相减等于某个值,是否可以对一个值求和?

Is it possible to sum a value if the substraction of two value on the same row equals something?

我正在尝试构建一个 sheet 以查看我每个月需要支付的金额。

假设我有以下 table

Current installment (CI) Total installments (TI) Installment amount (IA)
1 3 0
1 1 0
2 3 0
1 3
2 4 0
1 1

所以,第一个月如果 TI-CI >= 1,那么我将对该值求和。在接下来的一个月里,我会做同样的事情,但是 TI-CI >= 2

结果会是这样的

- -
1st month debt 5 (the result of 100+150+75+100)
2nd month debt 5 (the result of 100+75+150)
3rd month debt 0

这可能吗?

尝试:

=IFNA(SUM(FILTER(C:C, (B:B-A:A)>=ROW(A1))))

并向下拖动