I want to write a formula where I can add values to a cell whether another cell states approves the transaction.It will be easier to explain with an example. Consider a spreadsheet containing the costs of a flat share. Purchase    Adam Joe Peter To x           $5  $5   $0   Peter y           $0  $7   $7   AdamGiven the table above, I would like to create another table showing how much money do people owe each other:      Owe to      Adam  Joe  PeterAdam   $0    $0   $5Joe    $7    $0   $5Peter  $7    $0   $0I am not sure how to create the second table. Any ideas how? I was thinking of something along the lines of a loop, and if statements. 
Text conditionals in Google Spreadsheets
google spreadsheets;formulas