Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 161
Default COUNTIF Multiple Values

Hi,

I have two columns of fixed, equal, size (A1:A100 and B1:B100).
Both columns are completely populated by formulae returning values from
other parts of the workbook, These values are text not numeric. Where there
is no value, the cell is empty (other than the formula, of course). It is not
possible for A to be empty and B not to be emptty and vice versa.

The whole thing looks something like:

A B
1 Apple Pie
2
3 Pear Juice
4 Apple Pie
..
..
100 Apple Juice

What I want to do is count the number of each variation and output it in a
table:
Pie Juice
Apple 2 1
Pear 0 1

This seems to requre ANDing two COUNTIF statements, along the lines of:

=AND(countif(A1:A100,"apple"),countif(B1:B100,"Pie ")

With each cell of the table having a custom variation of this formula. The
AND statement is returning a TRUE or FALSE, so how do I count the number of
Apple Pies, Apple Juices, Pear Pies etc?

TIA

Dave
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default COUNTIF Multiple Values

Try this:

With your posted set up...

F1: Pie
G1: Juice

E2: Apple
E3: Pear

F2: =SUMPRODUCT(--($A$2:$A$100=$E2),--($B$2:$B$100=F$1))
Copy F2 across and down through G3

Alternatively, you could just use a pivot table which would automatically
create the structure you're looking for

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Risky Dave" wrote in message
...
Hi,

I have two columns of fixed, equal, size (A1:A100 and B1:B100).
Both columns are completely populated by formulae returning values from
other parts of the workbook, These values are text not numeric. Where
there
is no value, the cell is empty (other than the formula, of course). It is
not
possible for A to be empty and B not to be emptty and vice versa.

The whole thing looks something like:

A B
1 Apple Pie
2
3 Pear Juice
4 Apple Pie
.
.
100 Apple Juice

What I want to do is count the number of each variation and output it in a
table:
Pie Juice
Apple 2 1
Pear 0 1

This seems to requre ANDing two COUNTIF statements, along the lines of:

=AND(countif(A1:A100,"apple"),countif(B1:B100,"Pie ")

With each cell of the table having a custom variation of this formula. The
AND statement is returning a TRUE or FALSE, so how do I count the number
of
Apple Pies, Apple Juices, Pear Pies etc?

TIA

Dave



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 161
Default COUNTIF Multiple Values

Perfik!

Many thanks

"Ron Coderre" wrote:

Try this:

With your posted set up...

F1: Pie
G1: Juice

E2: Apple
E3: Pear

F2: =SUMPRODUCT(--($A$2:$A$100=$E2),--($B$2:$B$100=F$1))
Copy F2 across and down through G3

Alternatively, you could just use a pivot table which would automatically
create the structure you're looking for

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Risky Dave" wrote in message
...
Hi,

I have two columns of fixed, equal, size (A1:A100 and B1:B100).
Both columns are completely populated by formulae returning values from
other parts of the workbook, These values are text not numeric. Where
there
is no value, the cell is empty (other than the formula, of course). It is
not
possible for A to be empty and B not to be emptty and vice versa.

The whole thing looks something like:

A B
1 Apple Pie
2
3 Pear Juice
4 Apple Pie
.
.
100 Apple Juice

What I want to do is count the number of each variation and output it in a
table:
Pie Juice
Apple 2 1
Pear 0 1

This seems to requre ANDing two COUNTIF statements, along the lines of:

=AND(countif(A1:A100,"apple"),countif(B1:B100,"Pie ")

With each cell of the table having a custom variation of this formula. The
AND statement is returning a TRUE or FALSE, so how do I count the number
of
Apple Pies, Apple Juices, Pear Pies etc?

TIA

Dave




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default COUNTIF Multiple Values

You're very welcome....I'm glad I could help.

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Risky Dave" wrote in message
...
Perfik!

Many thanks

"Ron Coderre" wrote:

Try this:

With your posted set up...

F1: Pie
G1: Juice

E2: Apple
E3: Pear

F2: =SUMPRODUCT(--($A$2:$A$100=$E2),--($B$2:$B$100=F$1))
Copy F2 across and down through G3

Alternatively, you could just use a pivot table which would automatically
create the structure you're looking for

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Risky Dave" wrote in message
...
Hi,

I have two columns of fixed, equal, size (A1:A100 and B1:B100).
Both columns are completely populated by formulae returning values from
other parts of the workbook, These values are text not numeric. Where
there
is no value, the cell is empty (other than the formula, of course). It
is
not
possible for A to be empty and B not to be emptty and vice versa.

The whole thing looks something like:

A B
1 Apple Pie
2
3 Pear Juice
4 Apple Pie
.
.
100 Apple Juice

What I want to do is count the number of each variation and output it
in a
table:
Pie Juice
Apple 2 1
Pear 0 1

This seems to requre ANDing two COUNTIF statements, along the lines of:

=AND(countif(A1:A100,"apple"),countif(B1:B100,"Pie ")

With each cell of the table having a custom variation of this formula.
The
AND statement is returning a TRUE or FALSE, so how do I count the
number
of
Apple Pies, Apple Juices, Pear Pies etc?

TIA

Dave






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 with multiple text values in cell Rothman Excel Discussion (Misc queries) 3 February 25th 08 03:46 AM
Nesting COUNTIF for multiple criteria in multiple columns NeedExcelHelp07 Excel Worksheet Functions 1 December 12th 07 05:47 PM
Adding multiple values in one column based on multiple values of the same value (text) in another column [email protected] Excel Discussion (Misc queries) 1 May 16th 07 06:02 PM
Using COUNTIF to check values in multiple columns DTomSimpson Excel Worksheet Functions 2 March 29th 05 04:47 AM
Countif with multiple criteria and multiple worksheets JJ Excel Worksheet Functions 1 December 28th 04 06:37 PM


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