Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I have set up a form with google spreadsheet where I want to collect grocery spendings for different people. How can I sum spendings for different persons? Each row has a column with the person's name and the amount spent.

Let me give an example for the problem:

Table:

A      B
Name Amount
Me    1 
You   2
Me    3
Me    4
You   5

I want to SUM column B where column A = "Me" so the result is 8.

share|improve this question
add comment

migrated from superuser.com Feb 22 '11 at 14:35

This question came from our site for computer enthusiasts and power users.

2 Answers

up vote 11 down vote accepted

You can use the SUMIF function to calculate the total sum for each person.

If you enter the following formula in a cell you like, it will give you the total amount spent by "Me":

=SUMIF(A2:A6,"=Me",B2:B6)

where A2:A6 is the Range, "=Me" is the Criteria, and B2:B6 is the Sum_Range.

share|improve this answer
    
Here's how to get a list of available functions –  none Feb 23 '11 at 7:50
    
For this to work in non-US locales you need to use ";" instead of "," in the statement above. Otherwise you'll get an "#ERROR!". –  Emil Stenström Feb 20 '13 at 9:27
    
@EmilStenström: True. I have Turkish locale and I always use ; in Excel formulas. Additionally, if you work with macros in Excel, you always have to use , for formulas in your code even if you have non-US locales. –  Mehper C. Palavuzlar Feb 20 '13 at 20:10
add comment

what if there is a second argument? For eg. is there a way to find out filter out only the purchases made on Sunday.

So the filtered value will be You = 2 and Me = 3

A      B       C
Name Amount Day of purchase
Me    1       Monday
You   2       Sunday
Me    3       Sunday
Me    4       Tuesday
You   5       Monday
share|improve this answer
    
Is this an answer to the question, or are you posing a different question? –  Vidar S. Ramdal Oct 17 '12 at 11:57
add comment

Your Answer

 
discard

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.