#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Countif

Question:

I have a lookup table:

A
Fruits:
Apple
Orange

B
Dairy:
Milk
Cheese

And I have a list:

Milk
Orange
Cheese

I want to set up a formula to count from the list:

# of Fruit
and
# of Dairy

Please help.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Countif

With the list in D1:D3

Fruits in A2:A3
Dairy in B2:B3

For the count of fruits:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))

Copy across to get the count of dairy

Biff

"Sweepea" wrote in message
...
Question:

I have a lookup table:

A
Fruits:
Apple
Orange

B
Dairy:
Milk
Cheese

And I have a list:

Milk
Orange
Cheese

I want to set up a formula to count from the list:

# of Fruit
and
# of Dairy

Please help.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Countif

Thanks, Biff.

This formula helps but it's not counting same fruit or dairy items that
appear twice.

Example, the list could be:

Apple
Apple
Orange

This formula only return a count of 2 which should really be 3.

Please advise. Thank you very much.

"T. Valko" wrote:

With the list in D1:D3

Fruits in A2:A3
Dairy in B2:B3

For the count of fruits:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))

Copy across to get the count of dairy

Biff

"Sweepea" wrote in message
...
Question:

I have a lookup table:

A
Fruits:
Apple
Orange

B
Dairy:
Milk
Cheese

And I have a list:

Milk
Orange
Cheese

I want to set up a formula to count from the list:

# of Fruit
and
# of Dairy

Please help.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Countif

Just reverse the ranges in the Match function:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))


=SUMPRODUCT(--(ISNUMBER(MATCH($D1:$D3,A2:A3,0))))

Biff

"Sweepea" wrote in message
...
Thanks, Biff.

This formula helps but it's not counting same fruit or dairy items that
appear twice.

Example, the list could be:

Apple
Apple
Orange

This formula only return a count of 2 which should really be 3.

Please advise. Thank you very much.

"T. Valko" wrote:

With the list in D1:D3

Fruits in A2:A3
Dairy in B2:B3

For the count of fruits:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))

Copy across to get the count of dairy

Biff

"Sweepea" wrote in message
...
Question:

I have a lookup table:

A
Fruits:
Apple
Orange

B
Dairy:
Milk
Cheese

And I have a list:

Milk
Orange
Cheese

I want to set up a formula to count from the list:

# of Fruit
and
# of Dairy

Please help.






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Countif

Thank you very much. It works!!


"T. Valko" wrote:

Just reverse the ranges in the Match function:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))


=SUMPRODUCT(--(ISNUMBER(MATCH($D1:$D3,A2:A3,0))))

Biff

"Sweepea" wrote in message
...
Thanks, Biff.

This formula helps but it's not counting same fruit or dairy items that
appear twice.

Example, the list could be:

Apple
Apple
Orange

This formula only return a count of 2 which should really be 3.

Please advise. Thank you very much.

"T. Valko" wrote:

With the list in D1:D3

Fruits in A2:A3
Dairy in B2:B3

For the count of fruits:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))

Copy across to get the count of dairy

Biff

"Sweepea" wrote in message
...
Question:

I have a lookup table:

A
Fruits:
Apple
Orange

B
Dairy:
Milk
Cheese

And I have a list:

Milk
Orange
Cheese

I want to set up a formula to count from the list:

# of Fruit
and
# of Dairy

Please help.









  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Countif

You're welcome. Thanks for the feedback!

Biff

"Sweepea" wrote in message
...
Thank you very much. It works!!


"T. Valko" wrote:

Just reverse the ranges in the Match function:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))


=SUMPRODUCT(--(ISNUMBER(MATCH($D1:$D3,A2:A3,0))))

Biff

"Sweepea" wrote in message
...
Thanks, Biff.

This formula helps but it's not counting same fruit or dairy items that
appear twice.

Example, the list could be:

Apple
Apple
Orange

This formula only return a count of 2 which should really be 3.

Please advise. Thank you very much.

"T. Valko" wrote:

With the list in D1:D3

Fruits in A2:A3
Dairy in B2:B3

For the count of fruits:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A3,$D1:$D3,0))))

Copy across to get the count of dairy

Biff

"Sweepea" wrote in message
...
Question:

I have a lookup table:

A
Fruits:
Apple
Orange

B
Dairy:
Milk
Cheese

And I have a list:

Milk
Orange
Cheese

I want to set up a formula to count from the list:

# of Fruit
and
# of Dairy

Please help.









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
sumproduct vs. countif Coal Miner Excel Discussion (Misc queries) 1 June 15th 06 09:34 PM
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 - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM


All times are GMT +1. The time now is 10:23 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"