PC Review


Reply
Thread Tools Rate Thread

COUNTIF with multiple text criteria

 
 
Richard
Guest
Posts: n/a
 
      2nd Mar 2009
Hi all

I need to count all instances of Word1 in column A, but only where
column 2 contains Word2. (and then multiply the result by a factor of
n - if that's possible?)

I've got as far as: =COUNTIF(A:A,"Word1")*10 - but it stops working
when I add the column 2 criteria.

Have tried using =SUMPRODUCT but think that is for numbers only?

Hope my requirements are possible.

thanks in advance

Richard
 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      2nd Mar 2009
Try this:

=SUMPRODUCT((A$1:A$100="Word1")*(B$1:B$100="Word2")) * factor

Note that if you are using Excel 2003 or earlier then you can't use
full-column references with SUMPRODUCT, so adjust those given to suit
your data.

It would be better to put Word1 and Word2 in two different cells (eg
C1 and D1), then you could have this formula:

=SUMPRODUCT((A$1:A$100=C1)*(B$1:B$100=D1))* factor

The advantage is that you don't have to change the formula to check
out different words, and by having other words in columns C and D then
you can just copy the formula down.

Hope this helps.

Pete

On Mar 2, 4:15*pm, Richard <richard.st...@gmail.com> wrote:
> Hi all
>
> I need to count all instances of Word1 in column A, but only where
> column 2 contains Word2. (and then multiply the result by a factor of
> n - if that's possible?)
>
> I've got as far as: =COUNTIF(A:A,"Word1")*10 - but it stops working
> when I add the column 2 criteria.
>
> Have tried using =SUMPRODUCT but think that is for numbers only?
>
> Hope my requirements are possible.
>
> thanks in advance
>
> Richard


 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      2nd Mar 2009
=SUMPRODUCT((A1:A100="word1")*(B1:B100="word2"))*10
and see:

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
for the "rest of the story"
--
Gary''s Student - gsnu2007L


"Richard" wrote:

> Hi all
>
> I need to count all instances of Word1 in column A, but only where
> column 2 contains Word2. (and then multiply the result by a factor of
> n - if that's possible?)
>
> I've got as far as: =COUNTIF(A:A,"Word1")*10 - but it stops working
> when I add the column 2 criteria.
>
> Have tried using =SUMPRODUCT but think that is for numbers only?
>
> Hope my requirements are possible.
>
> thanks in advance
>
> Richard
>

 
Reply With Quote
 
Shane Devenshire
Guest
Posts: n/a
 
      2nd Mar 2009
Hi,

If you are using 2007:

=COUNTIFS(A:A,"Word 1",B:B,"Word 2")*Factor

or

=COUNTIFS(A:A,D1,B:B,D2)*Factor

Where Word 1 is in D1 and Word 2 is in D2.


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Richard" wrote:

> Hi all
>
> I need to count all instances of Word1 in column A, but only where
> column 2 contains Word2. (and then multiply the result by a factor of
> n - if that's possible?)
>
> I've got as far as: =COUNTIF(A:A,"Word1")*10 - but it stops working
> when I add the column 2 criteria.
>
> Have tried using =SUMPRODUCT but think that is for numbers only?
>
> Hope my requirements are possible.
>
> thanks in advance
>
> Richard
>

 
Reply With Quote
 
francis
Guest
Posts: n/a
 
      2nd Mar 2009
you can use Sumproduct in this case

=SUMPRODUCT((A2:A10="Word1")*(B2:B10="Word2")*10

The range need to be the same for this function and you can't
use whole column in 2003.
--
Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked


Thank You

cheers, francis





"Richard" wrote:

> Hi all
>
> I need to count all instances of Word1 in column A, but only where
> column 2 contains Word2. (and then multiply the result by a factor of
> n - if that's possible?)
>
> I've got as far as: =COUNTIF(A:A,"Word1")*10 - but it stops working
> when I add the column 2 criteria.
>
> Have tried using =SUMPRODUCT but think that is for numbers only?
>
> Hope my requirements are possible.
>
> thanks in advance
>
> Richard
>

 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      2nd Mar 2009
Many thanks for your lightning responses guys.


=SUMPRODUCT((A1:A100="word1")*(B1:B100="word2"))*10 - did it for me,
plus the web link helped explain things.


Sorry Francis no yes button! - but feel free to click it for me if you
have one


thanks again

Richard
(using office 2007)



On 2 Mar, 16:55, francis <fran...@discussions.microsoft.com> wrote:
> you can use Sumproduct in this case
>
> =SUMPRODUCT((A2:A10="Word1")*(B2:B10="Word2")*10
>
> The range need to be the same for this function and you can't
> use whole column in 2003.
> --
> Hope this is helpful
>
> Pls click the Yes button below if this post provide answer you have asked*
>
> Thank You
>
> cheers, francis
>
> "Richard" wrote:
> > Hi all

>
> > I need to count all instances of Word1 in column A, but only where
> > column 2 contains Word2. (and then multiply the result by a factor of
> > n - if that's possible?)

>
> > I've got as far as: =COUNTIF(A:A,"Word1")*10 - but it stops working
> > when I add the column 2 criteria.

>
> > Have tried using =SUMPRODUCT but think that is for numbers only?

>
> > Hope my requirements are possible.

>
> > thanks in advance

>
> > Richard


 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      10th Mar 2009
Hello again

You guys kindly helped me with SUMPRODUCT.
The formula you helped with with was =SUMPRODUCT((A1:A100="word1")*
(B1:B100="word2"))

I now have need for a formula to count occurances of Word1 in Column
B, but only if it is NOT in column A
And another to count occurances of Word1 in Column C, but only if it
is NOT in Column B or Column A.

Tried putting a minus in place of the * but without success.


Thanks in advance

Richard
 
Reply With Quote
 
Jarek Kujawa
Guest
Posts: n/a
 
      10th Mar 2009
> I now have need for a formula to count occurances of Word1 in Column
> B, but only if it is NOT in column A


=SUMPRODUCT((NOT($A$1:$A$100="Word1"))*($B$1:$B$100="Word1"))




Uzytkownik "Richard" <(E-Mail Removed)> napisal w wiadomosci
news:fd41da91-0987-469d-ae69-(E-Mail Removed)...
> Hello again
>
> You guys kindly helped me with SUMPRODUCT.
> The formula you helped with with was =SUMPRODUCT((A1:A100="word1")*
> (B1:B100="word2"))
>
> I now have need for a formula to count occurances of Word1 in Column
> B, but only if it is NOT in column A
> And another to count occurances of Word1 in Column C, but only if it
> is NOT in Column B or Column A.
>
> Tried putting a minus in place of the * but without success.
>
>
> Thanks in advance
>
> Richard



 
Reply With Quote
 
Jarek Kujawa
Guest
Posts: n/a
 
      10th Mar 2009
>> I now have need for a formula to count occurances of Word1 in Column
>> B, but only if it is NOT in column A

another way
=SUMPRODUCT(($A$1:$A$100<>"Word1"))*($B$1:$B$100="Word1"))

>> And another to count occurances of Word1 in Column C, but only if it
>> is NOT in Column B or Column A.

hope you meant NOT in Column B AND NOT in Column A.
then
=SUMPRODUCT(($A$1:$A$100<>"Word1")*($B$1:$B$100<>"Word1")*($C$1:$C$100="Word1"))

at the moment I cannot think of a SUMPRODUCT formula to count occurances of
Word1 in Column C, but only if it
is NOT in Column B or Column A.

instead try:

=SUM(IF((($A$1:$A$100<>"Word1")+($B$1:$B$100<>"Word1"))*($C$1:$C$100="Word1"),1,))

CTRL+SHIFT+ENTER this formula instead of just using ENTER cause this is an
array-formula

if it is inserted correctly curly brackets should show up just like in this
pattern

{=SUM(IF((($A$1:$A$100<>"Word1")+($B$1:$B$100<>"Word1"))*($C$1:$C$100="Word1"),1,))}

DO NOT insert curly brackets by hand, the formula will not work



Użytkownik "Jarek Kujawa" <(E-Mail Removed)> napisał w wiadomości
news:%(E-Mail Removed)...
>> I now have need for a formula to count occurances of Word1 in Column
>> B, but only if it is NOT in column A

>
> =SUMPRODUCT((NOT($A$1:$A$100="Word1"))*($B$1:$B$100="Word1"))
>
>
>
>
> Uzytkownik "Richard" <(E-Mail Removed)> napisal w wiadomosci
> news:fd41da91-0987-469d-ae69-(E-Mail Removed)...
>> Hello again
>>
>> You guys kindly helped me with SUMPRODUCT.
>> The formula you helped with with was =SUMPRODUCT((A1:A100="word1")*
>> (B1:B100="word2"))
>>
>> I now have need for a formula to count occurances of Word1 in Column
>> B, but only if it is NOT in column A
>> And another to count occurances of Word1 in Column C, but only if it
>> is NOT in Column B or Column A.
>>
>> Tried putting a minus in place of the * but without success.
>>
>>
>> Thanks in advance
>>
>> Richard

>
>



 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      11th Mar 2009
Many thanks for your help Jarek

I got both formulas to work as needed. It was 'NOT in Column B AND NOT
in Column A.' that I required.

thanks again

Richard
 
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
COUNTIF multiple criteria SJC Microsoft Excel Worksheet Functions 2 6th Nov 2008 06:08 PM
Nesting COUNTIF for multiple criteria in multiple columns NeedExcelHelp07 Microsoft Excel Worksheet Functions 1 12th Dec 2007 05:47 PM
COUNTIF using multiple criteria =?Utf-8?B?VHJpdGFuaXVtWmVybw==?= Microsoft Excel Misc 5 18th Jul 2007 12:03 PM
countif multiple criteria =?Utf-8?B?SWFtd2hvaWFt?= Microsoft Excel Worksheet Functions 1 27th Jun 2006 08:26 PM
Multiple (text) criteria in a "countif" function?? Muse 0f Fire Microsoft Excel Misc 4 28th Sep 2004 03:28 PM


Features
 

Advertising
 

Newsgroups
 


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