PC Review


Reply
Thread Tools Rate Thread

How do I count the times a number appears in a table using criteri

 
 
Scoob_a
Guest
Posts: n/a
 
      19th Jun 2008
I'm getting really confused....

I need to count how many times a number appears if it has a specific word
written next to it....for example....

A B
1 1 Summer 1
2 2 Summer 2
3 1 Autumn 1
4 3 Autumn 2

I need to count how many times the number 1, 2 and 3 appear next to Autumn 2
in the table..... does that make any sense?
I've tried using the Dcount function and either I'm not doing it right, or
it doesn't work for this... The countif formula works if I don't need to
specify summer or autumn, but in this case I do...
Can anyone help?...Please? It's driving me nuts!
Thanks
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      19th Jun 2008
Hi,

=SUMPRODUCT((A1:A22=ROW(A1))*(B1:B22="Summer 1"))

Put this in a cell and drag down 2 rows
Row 1 = 1 and summer 1
Row 2 = 2 and summer 1
etc

Mike

"Scoob_a" wrote:

> I'm getting really confused....
>
> I need to count how many times a number appears if it has a specific word
> written next to it....for example....
>
> A B
> 1 1 Summer 1
> 2 2 Summer 2
> 3 1 Autumn 1
> 4 3 Autumn 2
>
> I need to count how many times the number 1, 2 and 3 appear next to Autumn 2
> in the table..... does that make any sense?
> I've tried using the Dcount function and either I'm not doing it right, or
> it doesn't work for this... The countif formula works if I don't need to
> specify summer or autumn, but in this case I do...
> Can anyone help?...Please? It's driving me nuts!
> Thanks

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      19th Jun 2008
Separately?

=SUMPRODUCT(--(A1:A10=1),--(B1:B10="Autumn 2"))

etc.

Or all at once?

=SUMPRODUCT((A1:A10={1,2,3})*(B1:B10="Autumn 2"))

--
__________________________________
HTH

Bob

"Scoob_a" <(E-Mail Removed)> wrote in message
news:580531BA-8B43-47E5-964E-(E-Mail Removed)...
> I'm getting really confused....
>
> I need to count how many times a number appears if it has a specific word
> written next to it....for example....
>
> A B
> 1 1 Summer 1
> 2 2 Summer 2
> 3 1 Autumn 1
> 4 3 Autumn 2
>
> I need to count how many times the number 1, 2 and 3 appear next to Autumn
> 2
> in the table..... does that make any sense?
> I've tried using the Dcount function and either I'm not doing it right, or
> it doesn't work for this... The countif formula works if I don't need to
> specify summer or autumn, but in this case I do...
> Can anyone help?...Please? It's driving me nuts!
> Thanks



 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      19th Jun 2008
Try this:

=SUMPRODUCT((A1:A4=1)*(B1:B4="Autumn2))

Adjust the ranges to suit, but you can't use full-column references
(unless you are using XL2007).

Change the =1 in the first term to get counts for the other values in
column A, or you could use a cell to hold the values.

Hope this helps.

Pete



On Jun 19, 12:59*pm, Scoob_a <Sco...@discussions.microsoft.com> wrote:
> I'm getting really confused....
>
> I need to count how many times a number appears if it has a specific word
> written next to it....for example....
>
> * * *A * * * * B
> 1 * *1 * * *Summer 1
> 2 * *2 * * *Summer 2
> 3 * *1 * * *Autumn 1
> 4 * *3 * * *Autumn 2
>
> I need to count how many times the number 1, 2 and 3 appear next to Autumn 2
> in the table..... does that make any sense?
> I've tried using the Dcount function and either I'm not doing it right, or
> it doesn't work for this... The countif formula works if I don't need to
> specify summer or autumn, but in this case I do...
> Can anyone help?...Please? *It's driving me nuts!
> Thanks


 
Reply With Quote
 
Scoob_a
Guest
Posts: n/a
 
      19th Jun 2008
Brilliant! My brain is happy again!

"Bob Phillips" wrote:

> Separately?
>
> =SUMPRODUCT(--(A1:A10=1),--(B1:B10="Autumn 2"))
>
> etc.
>
> Or all at once?
>
> =SUMPRODUCT((A1:A10={1,2,3})*(B1:B10="Autumn 2"))
>
> --
> __________________________________
> HTH
>
> Bob
>
> "Scoob_a" <(E-Mail Removed)> wrote in message
> news:580531BA-8B43-47E5-964E-(E-Mail Removed)...
> > I'm getting really confused....
> >
> > I need to count how many times a number appears if it has a specific word
> > written next to it....for example....
> >
> > A B
> > 1 1 Summer 1
> > 2 2 Summer 2
> > 3 1 Autumn 1
> > 4 3 Autumn 2
> >
> > I need to count how many times the number 1, 2 and 3 appear next to Autumn
> > 2
> > in the table..... does that make any sense?
> > I've tried using the Dcount function and either I'm not doing it right, or
> > it doesn't work for this... The countif formula works if I don't need to
> > specify summer or autumn, but in this case I do...
> > Can anyone help?...Please? It's driving me nuts!
> > Thanks

>
>
>

 
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
Trying to count the number of times a name appears / table Terry Microsoft Excel Worksheet Functions 4 8th Jul 2009 03:52 AM
How do I count the number of times a value appears? =?Utf-8?B?Q2hyaXN0aW5l?= Microsoft Excel Worksheet Functions 2 8th Feb 2007 09:38 PM
display and count the number of times a value appears =?Utf-8?B?ZGJhdGg=?= Microsoft Excel Worksheet Functions 8 24th Jun 2006 07:57 AM
Query to Count Number of Times a Value appears for certain criteri =?Utf-8?B?SiBEaXp6bGUgRml6emxl?= Microsoft Access Queries 3 16th Feb 2006 09:21 PM
Count Number of Times Something appears =?Utf-8?B?TWFyayBC?= Microsoft Excel Worksheet Functions 5 29th Nov 2005 08:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:43 AM.