Question

I have a table:

a        1

b        2

c        3

and I want to use a SUMPRODUCT that will give me the total if the cell is a or b.

I have a cell that shows:

a/b

and I want to use either SUMIF or SUMPRODUCT to give me the total if it is a or b.

I wrote this:

=SUMPRODUCT(--(A2:A4=LEFT(A7,1)))

Do you think there is a way to use an OR within the SUMPRODUCT so that it can check for b within the table and give the total of that?

Was it helpful?

Solution

In a SUMPRODUCT formula OR is +. AND is *

=SUMPRODUCT(--(A2:A4=LEFT(A7,1))+(A2:A4=LEFT(B7,1))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top