0
1
I want to calculate the transaction value so by that i mean i've got different accounts in column "A" and for each transaction i got a column like "B".
The transactions show the new value, after the transaction, for two accounts.
And i need a generic function to calculate the "transaction value", something like Ai - Bi … Ai+1 - Bi+1 …
or as a function (pseudocode), something like this:
int res = 0;
foreach (int i = 1; i < 4 (rows); i++) {
if (Bi != null && Ai > Bi) {
res = Ai - Bi
}
}
Example:
A B (transactions)
------------------------------------------------------------
1 | $ 100 | |
------------------------------------------------------------
2 | | |
------------------------------------------------------------
3 | $ 200 | $ 150 (now, after transaction) |
------------------------------------------------------------
4 | $ 300 | $ 350 (now, after transaction) |
------------------------------------------------------------
5 | sum(A1:A4) | (A1-B1)+(A2-B2)+(A3-B3)… (transaction value)|
------------------------------------------------------------
=> | $ 600 | $ 50 |
------------------------------------------------------------
So i transferred $50 from Account A3 to A4.
I mainly need the logic behind this
Any help is very much appreciated :)
So
=SUM(A1:A4)-SUM(B1:B4)
??? – Scott Craner – 2016-06-30T20:30:50.510no; like in my above example if i would do that B6 would be 600-(150+350) => 100 and not 50! – dnepro – 2016-06-30T20:40:15.937