# How to find the sum of specific rows in Column A if rows in Column B meets a given requirement in Google Sheets?

I have a large project where I need to gather and analyze data. I have three columns in a Google Sheets:

• Column A is the amount of Favorites a tweet receives on Twitter
• Column B is the amount of retweets it received
• Column C shows the continent the tweet came from.

I need a fourth column which groups up the total amount of Favorites a tweet got in each continent. (So there should be seven rows in Column D). And I also need a fifth column with the total amount of retweets a continent received.

The challenge is finding a function to go through all of the rows in column C and be able to tell to sum up all the ones with the same continent name.

• The spreadsheet you linked isn't shared publicly. – Yisroel Tech Feb 16 '17 at 7:47

Create a Pivot table (under Data) with `C` for Rows and `A` and `B` (Summarise by SUM) for Values.

What you need is the classic `SUMIF` formula usage.

In column `D` use (in `D1`):

``````=SUMIF(C:C,"Asia",A:A)
``````

(change `Asia` to the other 6 continents for rows 2-7

And for column `E` use:

``````=SUMIF(C:C,"Asia",B:B)
``````