PC Review


Reply
Thread Tools Rate Thread

Counting something

 
 
Slim Slender
Guest
Posts: n/a
 
      4th Nov 2010
Game Count Team Errors Type
1 1 Home None n/a
1 Visitor None n/a
2 1 Home Error A
2 Visitor None n/a
3 1 Home None n/a
3 Visitor Error B
4 1 Home Error C
4 Home Error D
4 Visitor None n/a
5 1 Home Error A
5 Home Error B
5 Home Error C
5 Visitor Error A
6 1 Home None n/a
6 Visitor Error A
6 Visitor Error B

Here is some dummy sample data. The "Count" field contains a formula:
=if(countif(a$2:a2,a2)>1,"",1) which gives a count of unique games in
a PivotTable. I can also very easily get a count of Total Errors with
a PT. What I can't figure out is how to get a count of Games with
Errors which I know is 5 (Games 2 thru 6). Any solution is welcomed:
one or more new fields in the data table, a calculated field in a PT,
a sumproduct or any other formula, whatever works.
 
Reply With Quote
 
 
 
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      5th Nov 2010
On Nov 4, 6:18*pm, Slim Slender <slimslen...@gmail.com> wrote:
> Game * *Count * Team * *Errors *Type
> 1 * * * 1 * * * Home * *None * *n/a
> 1 * * * * * * * Visitor None * *n/a
> 2 * * * 1 * * * Home * *Error * A
> 2 * * * * * * * Visitor None * *n/a
> 3 * * * 1 * * * Home * *None * *n/a
> 3 * * * * * * * Visitor Error * B
> 4 * * * 1 * * * Home * *Error * C
> 4 * * * * * * * Home * *Error * D
> 4 * * * * * * * Visitor None * *n/a
> 5 * * * 1 * * * Home * *Error * A
> 5 * * * * * * * Home * *Error * B
> 5 * * * * * * * Home * *Error * C
> 5 * * * * * * * Visitor Error * A
> 6 * * * 1 * * * Home * *None * *n/a
> 6 * * * * * * * Visitor Error * A
> 6 * * * * * * * Visitor Error * B
>
> Here is some dummy sample data. The "Count" field contains a formula:
> =if(countif(a$2:a2,a2)>1,"",1) which gives a count of unique games in
> a PivotTable. I can also very easily get a count of Total Errors with
> a PT. What I can't figure out is how to get a count of Games with
> Errors which I know is 5 (Games 2 thru 6). Any solution is welcomed:
> one or more new fields in the data table, a calculated field in a PT,
> a sumproduct or any other formula, whatever works.


I don't like pivot tables but will try if you send (withOUT pivot
table) your desires
"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 
Reply With Quote
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      6th Nov 2010
On Nov 5, 9:21*am, Don Guillett Excel MVP <dguille...@austin.rr.com>
wrote:
> On Nov 4, 6:18*pm, Slim Slender <slimslen...@gmail.com> wrote:
>
>
>
>
>
> > Game * *Count * Team * *Errors *Type
> > 1 * * * 1 * * * Home * *None * *n/a
> > 1 * * * * * * * Visitor None * *n/a
> > 2 * * * 1 * * * Home * *Error * A
> > 2 * * * * * * * Visitor None * *n/a
> > 3 * * * 1 * * * Home * *None * *n/a
> > 3 * * * * * * * Visitor Error * B
> > 4 * * * 1 * * * Home * *Error * C
> > 4 * * * * * * * Home * *Error * D
> > 4 * * * * * * * Visitor None * *n/a
> > 5 * * * 1 * * * Home * *Error * A
> > 5 * * * * * * * Home * *Error * B
> > 5 * * * * * * * Home * *Error * C
> > 5 * * * * * * * Visitor Error * A
> > 6 * * * 1 * * * Home * *None * *n/a
> > 6 * * * * * * * Visitor Error * A
> > 6 * * * * * * * Visitor Error * B

>
> > Here is some dummy sample data. The "Count" field contains a formula:
> > =if(countif(a$2:a2,a2)>1,"",1) which gives a count of unique games in
> > a PivotTable. I can also very easily get a count of Total Errors with
> > a PT. What I can't figure out is how to get a count of Games with
> > Errors which I know is 5 (Games 2 thru 6). Any solution is welcomed:
> > one or more new fields in the data table, a calculated field in a PT,
> > a sumproduct or any other formula, whatever works.

>
> I don't like pivot tables but will try if you send (withOUT pivot
> table) your desires
> "If desired, send your file to dguillett *@gmail.com I will only look
> if:
> 1. You send a copy of this message on an inserted sheet
> 2. You give me the newsgroup and the subject line
> 3. You send a clear explanation of what you want
> 4. You send before/after examples and expected results."- Hide quoted text -
>
> - Show quoted text -


=IF(COUNTIF(A$2:A2,A2)>1,"",SUMPRODUCT(($A$2:$A$22=A2)*($C$2:$C
$22="error")))
 
Reply With Quote
 
Slim Slender
Guest
Posts: n/a
 
      6th Nov 2010
On Nov 6, 10:39*am, Don Guillett Excel MVP <dguille...@austin.rr.com>
wrote:
> On Nov 5, 9:21*am, Don Guillett Excel MVP <dguille...@austin.rr.com>
> wrote:
>
>
>
>
>
> > On Nov 4, 6:18*pm,SlimSlender<slimslen...@gmail.com> wrote:

>
> > > Game * *Count * Team * *Errors *Type
> > > 1 * * * 1 * * * Home * *None * *n/a
> > > 1 * * * * * * * Visitor None * *n/a
> > > 2 * * * 1 * * * Home * *Error * A
> > > 2 * * * * * * * Visitor None * *n/a
> > > 3 * * * 1 * * * Home * *None * *n/a
> > > 3 * * * * * * * Visitor Error * B
> > > 4 * * * 1 * * * Home * *Error * C
> > > 4 * * * * * * * Home * *Error * D
> > > 4 * * * * * * * Visitor None * *n/a
> > > 5 * * * 1 * * * Home * *Error * A
> > > 5 * * * * * * * Home * *Error * B
> > > 5 * * * * * * * Home * *Error * C
> > > 5 * * * * * * * Visitor Error * A
> > > 6 * * * 1 * * * Home * *None * *n/a
> > > 6 * * * * * * * Visitor Error * A
> > > 6 * * * * * * * Visitor Error * B

>
> > > Here is some dummy sample data. The "Count" field contains a formula:
> > > =if(countif(a$2:a2,a2)>1,"",1) which gives a count of unique games in
> > > a PivotTable. I can also very easily get a count of Total Errors with
> > > a PT. What I can't figure out is how to get a count of Games with
> > > Errors which I know is 5 (Games 2 thru 6). Any solution is welcomed:
> > > one or more new fields in the data table, a calculated field in a PT,
> > > a sumproduct or any other formula, whatever works.

>
> > I don't like pivot tables but will try if you send (withOUT pivot
> > table) your desires
> > "If desired, send your file to dguillett *@gmail.com I will only look
> > if:
> > 1. You send a copy of this message on an inserted sheet
> > 2. You give me the newsgroup and the subject line
> > 3. You send a clear explanation of what you want
> > 4. You send before/after examples and expected results."- Hide quoted text -

>
> > - Show quoted text -

>
> =IF(COUNTIF(A$2:A2,A2)>1,"",SUMPRODUCT(($A$2:$A$22=A2)*($C$2:$C
> $22="error")))- Hide quoted text -
>
> - Show quoted text -


Thanks for the effort but this doesn't get it. This formula has to be
in every record of the database and gives an array of results
answering the question "How many errors were there in each game
(including games with no errors)?" What I need is, as I said, "a
formula that gives the number of games in which there was an error" or
"a count of games with errors." This would be a single formula in a
single cell returning a single result. For example, the result for the
sample data is the number 5.
 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      8th Nov 2010
Is this array formula what you want

=SUM(--(FREQUENCY(IF(D220="Error",MATCH(A2:A20,A2:A20,0)),ROW(INDIRECT("1:"&ROWS(A2:A20))))>0))

This is an array formula.
This means that you use Ctrl-Shift-Enter to commit the formula, not just
Enter (array Enter it). Excel will put curly brackets around the formula in
the formula bar, you don't do this.
If you need to change the formula at any time, you must array Enter it
again.

--

HTH

Bob

"Slim Slender" <(E-Mail Removed)> wrote in message
news:72ebb142-d979-4621-991e-(E-Mail Removed)...
On Nov 6, 10:39 am, Don Guillett Excel MVP <dguille...@austin.rr.com>
wrote:
> On Nov 5, 9:21 am, Don Guillett Excel MVP <dguille...@austin.rr.com>
> wrote:
>
>
>
>
>
> > On Nov 4, 6:18 pm,SlimSlender<slimslen...@gmail.com> wrote:

>
> > > Game Count Team Errors Type
> > > 1 1 Home None n/a
> > > 1 Visitor None n/a
> > > 2 1 Home Error A
> > > 2 Visitor None n/a
> > > 3 1 Home None n/a
> > > 3 Visitor Error B
> > > 4 1 Home Error C
> > > 4 Home Error D
> > > 4 Visitor None n/a
> > > 5 1 Home Error A
> > > 5 Home Error B
> > > 5 Home Error C
> > > 5 Visitor Error A
> > > 6 1 Home None n/a
> > > 6 Visitor Error A
> > > 6 Visitor Error B

>
> > > Here is some dummy sample data. The "Count" field contains a formula:
> > > =if(countif(a$2:a2,a2)>1,"",1) which gives a count of unique games in
> > > a PivotTable. I can also very easily get a count of Total Errors with
> > > a PT. What I can't figure out is how to get a count of Games with
> > > Errors which I know is 5 (Games 2 thru 6). Any solution is welcomed:
> > > one or more new fields in the data table, a calculated field in a PT,
> > > a sumproduct or any other formula, whatever works.

>
> > I don't like pivot tables but will try if you send (withOUT pivot
> > table) your desires
> > "If desired, send your file to dguillett @gmail.com I will only look
> > if:
> > 1. You send a copy of this message on an inserted sheet
> > 2. You give me the newsgroup and the subject line
> > 3. You send a clear explanation of what you want
> > 4. You send before/after examples and expected results."- Hide quoted
> > text -

>
> > - Show quoted text -

>
> =IF(COUNTIF(A$2:A2,A2)>1,"",SUMPRODUCT(($A$2:$A$22=A2)*($C$2:$C
> $22="error")))- Hide quoted text -
>
> - Show quoted text -


Thanks for the effort but this doesn't get it. This formula has to be
in every record of the database and gives an array of results
answering the question "How many errors were there in each game
(including games with no errors)?" What I need is, as I said, "a
formula that gives the number of games in which there was an error" or
"a count of games with errors." This would be a single formula in a
single cell returning a single result. For example, the result for the
sample data is the number 5.


 
Reply With Quote
 
zvkmpw
Guest
Posts: n/a
 
      9th Nov 2010
> ... What I need is, as I said, "a
> formula that gives the number of games in which there was an error" or
> "a count of games with errors." This would be a single formula in a
> single cell returning a single result. For example, the result for the
> sample data is the number 5.


> Any solution is welcomed:
> one or more new fields in the data table, ...


This works for me, if I understand the problem correctly.

First put this in F2 and copy downward past the end of the data:
=AND(D2="ERROR",1=SUMPRODUCT((A$1:A2=A2)*(D$12="Error")))

Then use this formula:
=COUNTIF(F:F,TRUE)

Hide column F if desired.

Modify to suit.

Explanation: The AND formula tags those rows satisfying two
conditions: (a) the row has "Error" in column D and (b) no previous
row for the same game has "Error" in column D. Then count 'em up.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
counting function but not double counting duplicates =?Utf-8?B?SlJE?= Microsoft Excel Worksheet Functions 2 7th Nov 2007 06:43 PM
Counting rows, then counting values. Michael via OfficeKB.com Microsoft Excel Misc 7 4th Aug 2005 10:57 PM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Microsoft Excel Programming 1 1st Jun 2005 04:10 PM
Counting names in a column but counting duplicate names once =?Utf-8?B?VEJvZQ==?= Microsoft Excel Misc 9 11th May 2005 11:24 PM
12,000 and counting - dead, 1 Million and counting - homeless David Candy Windows XP General 34 1st Jan 2005 10:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 PM.