I have data like in the following table:+---+-----+-----+| A | B   | C   |+---+-----+-----+| 0 | 5   | 30  || 1 | 0   | 30  || 0 | 15  | 40  || 1 | 0   | 40  || 1 | 10  | 50  |+---+-----+-----+Column A is a flag (true = 1, false = 0) so we only add up rows with flag==1Column B is a tax to remove from the amount in Column CSo basically here, the total would be 110:(we don't count row 1)30-0(we don't count row 3)40-050-10How do I do it in Google Spreadsheet?
Total of column if adjacent cell is true while subtracting from another column
google spreadsheets
If you add the following formula in C7 with sum written in B7, then the total will be calculated the way you want:=SUM(ARRAYFORMULA(IF(A2:A6=1;C2:C6-B2:B6,0)))