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?

有帮助吗?

解决方案

In a SUMPRODUCT formula OR is +. AND is *

=SUMPRODUCT(--(A2:A4=LEFT(A7,1))+(A2:A4=LEFT(B7,1))
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top