Summing column only if value of one column matches with one cell.

solved

I’m trying to Sum a column if the text in a cell matches up with another.

.ABCDE
1Text 110Text 1Value
2Text 22
3Text 120
4Text 15

Then, on another section of the document, I have a drop down menu where you choose text 1 or text 2.

What I want to do is sum the information in column 2 that is the same as the text from drop down menu is the same as column 1. So if the drop down menu selects “Text 2”, the value is 2. If the drop down menu selects “Text 1” the value is 35.

I have tried using a formula shown below:

=SUMPRODUCT(COUNTIF(A1:A4,D1),B1:B4)

My thought was that this would bring back a 1 value for A1:A4 if the text is the same then multiply it by its corresponding cell. However, the COUNTIF is returning a numerical value (in this example it would be 3) not multiplying column by column.

Unsure how to proceed or which command would get me where I need to go.

Posted Jul 21, 2017, 9:48 PM UTC

37
Loading comments…