Count if match any of 3 strings

G

GGG

I'm using this formula and looking for a way to simplify it.

=SUM((COUNTIF(E5:E41,"DL380")*2),(COUNTIF(E5:E41,"DL580")*4)
(COUNTIF(E5:E41,"RP4400")*4), (COUNTIF(E5:E41,"DL585")*4))

As more models get added it will become tougher to maintain. I'
trying to say count all the cells with "RP4400, DL580 or DL585" i
them. The list will grow. Is there a way to say count if it matche
"any value stored in this range"
 
P

Peo Sjoblom

A couple of ways

=SUMPRODUCT((E5:E41={"DL380","DL580","RP4400","DL585"})*({2,4,4,4}))

or


=SUMPRODUCT(COUNTIF(E5:E41,{"DL380","DL580","RP4400","DL585"}),({2,4,4,4}))
 
D

Domenic

Try...

=SUMPRODUCT(COUNTIF(E5:E41,{"DL380","DL580","RP4400","DL585"}),{2,4,4,4})

or

=SUMPRODUCT(COUNTIF(E5:E41,A1:A4),B1:B4)

....where A1:B4 contains the following table...

DL380 2
DL580 4
RP4400 4
DL585 4

Hope this helps!
 

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