COUNTIF and OR

A

Annika

I have this table and want to use COUNTIF to find out:
If column A is Either Toyota Corolla OR Toyota Yaris, then sum up column B

A B

Toyota Corolla 15 000
Toyota Yaris 5 000
Volvo 20 000
Saab 10 000
Toyota Yaris 10 000
So I want to get the sum of 30 000.
 
R

Ron Coderre

Apart from just matching cells starting with "Toyota", you could try this:

=SUMPRODUCT((A1:A5={"Toyota Corolla","Toyota Yaris"})*B1:B5)

or this
=SUMIF(A1:A5,"*Corolla",B1:B5)+SUMIF(A1:A5,"*Yaris",B1:B5)

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
B

Bob Phillips

=SUMPRODUCT(SUMIF(A:A,{"Toyota Yaris","Toyota Corolla"},B:B))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
R

Ron Coderre

Try something like this:

With your data list in A1:E5

F2: =INDEX($A$1:$E$1,1,MATCH(MAX(B2:E2),A2:E2,0))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
R

Ron Coderre

Obviously, this post has nothing to do with THIS topic :/

I've got to get my computer fixed...
There's a loose nut in front of my keyboard!

***********
Regards,
Ron

XL2002, WinXP
 

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