HI.
If the data looks like this:
A B
1 Mary 10
2 John 20
3 Ryan 30
4 Pam 40
How can I write a formula that sums the value in column B if the value is either John or Pam?
Thanks!
HI.
If the data looks like this:
A B
1 Mary 10
2 John 20
3 Ryan 30
4 Pam 40
How can I write a formula that sums the value in column B if the value is either John or Pam?
Thanks!
The easiest way is probably to combine a couple SUMIF statements:
=SUMIF(A1:A4,"John",B1:B4)+SUMIF(A1:A4,"Pam",B1:B4)
Try:
=SUMPRODUCT((A1:A4="Mary")+(A1:A4="John"),B1:B4)
adjust ranges to suit
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Thank you both so much! Have decided to use the sumproduct formula instead as it is summing from another workbook.
If you're going to have multiple comparisons, then this version might be easier to add conditions to....
=SUMPRODUCT((A1:A4={"Mary","John"})*(B1:B4))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks