Excel Sum() ?

How can I sum a column based on the value of the column next to it. Let me explain:
Column A contains a number, and I want to sum column A1 to A100, but only for those cells where the corresponding B column contains an 'X'. So if B1 contains X then A1 would be part of the sum if B1 does not contain an X then A1 is skipped. And this would be so for each row.
LVL 1
Jess31Asked:
Who is Participating?
 
Patrick MatthewsConnect With a Mentor Commented:
Use SUMIF:

=SUMIF(B1:B100,"X",A1:A100)
0
 
santoshmotwaniCommented:
=SUMIF(A1:B7,1,B2:B7)


a      b
1      0
2      2
3      0
4      0
5      3
6      1
      
      
      
2      
0
 
santoshmotwaniCommented:
sorry its =sumif(A1:A8,1,B2:B7)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.