Counting occurances based on multiple variables

D

DSKR

I have a range of cells that hold 4 possible entries and another range that
holds 3 possible entries. Is it possible to COUNTIF/SUMPRODUCT if you for
more than one possibile entry in a cell range?

Here's an example:

Corp Sales 15
Corp Retrn 20
Corp Excha 20
Corp Retrn 0
Corp Excha 15

I want to count the number of occurances when column B reads either Retrn or
Excha and column C reads 15 or 20. In this case, the formula would return 3.

Any help would be appreciated...
 
L

Luke M

Something structured like this:

=SUMPRODUCT(--((B2:B100="Retrn")+(B2:B100="Excha")),--((C2:C100=15)+(C2:C100=20)))
 
T

T. Valko

Try this:

=SUMPRODUCT(--(ISNUMBER(MATCH(B1:B5,{"Retrn","Excha"},0))),--(ISNUMBER(MATCH(C1:C5,{15,20},0))))
 
T

T. Valko

=SUMPRODUCT(--((B2:B100="Retrn")+(B2:B100="Excha")),--((C2:C100=15)+(C2:C100=20)))

No need for the double unary:

=SUMPRODUCT((B2:B100="Retrn")+(B2:B100="Excha"),(C2:C100=15)+(C2:C100=20))
 
D

DSKR

Thanks!!!!!

Luke M said:
Something structured like this:

=SUMPRODUCT(--((B2:B100="Retrn")+(B2:B100="Excha")),--((C2:C100=15)+(C2:C100=20)))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top