Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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   Adam

Given the table above, I would like to create another table showing how much money do people owe each other:

      Owe to
      Adam  Joe  Peter
Adam   $0    $0   $5
Joe    $7    $0   $5
Peter  $7    $0   $0

I 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.

share|improve this question
Can you share a doc with us? – Jacob Jan Tuinstra Feb 5 '13 at 21:01

If you're thinking about "loop and if statements", you should look into Google Apps Scripts.

Other than that, it seems you're looking for the TRANSPOSE function, in conjunction with the FILTER function. Take a look at the Google Spreadsheets Function List.

If you can tell me the purpose of the Purchase column in your example, I might be able to set up a working example.

share|improve this answer
the Purchase column is simply a description of a purchase in the flat - its not directly relevant to the question. For example, Peter buys x, and it costs him $15 - so Adam and Joe each owe him $5. This is reflected in the Owe To table (the one I am trying to build). – Newton Oct 22 '12 at 15:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.