Let's use this random spreadsheet to illustrate my problem.

enter image description here

What I want to do is a sum of all Page Views (F) that contains the Category (B) named /Online Computers. Which formula can I use to do that?

I wanted to Google it before asking here but I'm not sure how this is called.


You can use the =SUMIF as MaryC says, or the =FILTER function that I usually prefer:

  =SUM(FILTER(F2:F, B2:B = "/Online Computers"))

The =FILTER function filters your data so that only rows matching B2:B = "/Online Computers" are included.

See the example spreadsheet I've set up, and the Google spreadsheets function list.

| improve this answer | |
  • Thank you, it also works! It's a semicolon instead of a comma though. – Renan May 19 '14 at 21:45
  • 1
    The , vs ; depends on your locale settings. – Vidar S. Ramdal May 20 '14 at 8:21
  • Oh. What else changes from place to place? – Renan May 20 '14 at 9:12
  • Nothing else, that I am aware of. – Vidar S. Ramdal May 20 '14 at 10:08

This is the function you want:

SUMIF(range, criterion, [sum_range])

Example SUMIF(A1:A10, ">20", B1:B10)

Summary Returns a conditional sum across a range.

range The range which is tested against 'criterion'.

criterion The pattern or test to apply to 'range'.

sum_range - [optional] The range to be added up, if different from 'range'.

More information here: https://support.google.com/drive/answer/3093583?hl=en-GB

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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