#1   Report Post  
Posted to microsoft.public.excel.misc
Annika
 
Posts: n/a
Default COUNTIF and OR

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.
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default COUNTIF and OR

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


"Annika" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default COUNTIF and OR

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

--
HTH

Bob Phillips

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

"Annika" wrote in message
...
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.



  #5   Report Post  
Posted to microsoft.public.excel.misc
Annika
 
Posts: n/a
Default COUNTIF and OR

Thanks all of you, it's working.

regards Annika



  #6   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default COUNTIF and OR

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


"Annika" wrote:

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.

  #7   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default COUNTIF and OR

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


"Ron Coderre" wrote:

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


"Annika" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif Formula /Sort Bug??? orcfodder Excel Discussion (Misc queries) 2 January 12th 06 10:04 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"