Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
force530
 
Posts: n/a
Default Conditional Countif

It appears all of the solutions work ... thanks. How would I add multiple
aguements in column B, the same column as oranges, i.e., pears, melons, etc?

"Bob Phillips" wrote:

Careful Andy,

OR((A1:A50="apples"),(A1:A50="grapes")) will evaluate to true if there is
even one occurrence of apples or grapes in column A, and thus will count all
occurrences of oranges in B. So Jim in A, oranges in B will count. Don't
think this is what is wanted.

Try instead.

=SUMPRODUCT(((A1:A10="apples")+(A1:A10="grapes"))* (B1:B10="oranges"))

or

=SUMPRODUCT(--((A1:A10="apples")+(A1:A10="grapes")),--(B1:B10="oranges"))

in my preferred style<vbg,

or most succinctly, and my preferred solution

=SUMPRODUCT(((A1:A10={"apples","grapes"}))*(B1:B10 ="oranges"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


<Andy wrote in message ...
Try this:
=SUMPRODUCT(OR((A1:A50="apples"),(A1:A50="grapes") )*(B1:B50="oranges"))

Andy.


"force530" wrote in message
...
Thanks ndy .. it works. What if I wanted to add grapes in column A along
with
Apples?

"Andy" wrote:

Hi

Try something like:
=SUMPRODUCT((A1:A50="apples")*(B1:B50="oranges"))
I don't quite understand the "If this occurs on multiple rows, I want

to
count them all as one sum." bit, but it's a start at least!

Andy.

"force530" wrote in message
...
I have two columns with lets say a range of 50 (a1:a50) and (B1:B50).

I
want
to count the number of occurences when a specific arguement occurs.
i.e.,
If
A23=apples and b23=oranges, I want to count this occurence, but only

if
this
occurs together on the same row. If this occurs on multiple rows, I
want
to
count them all as one sum.



  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(((A1:A10="apples")+(A1:A10="grapes"))* ((B1:B10="oranges")+(B1:B1
0="pears")))

--
HTH

Bob Phillips

"force530" wrote in message
...
It appears all of the solutions work ... thanks. How would I add multiple
aguements in column B, the same column as oranges, i.e., pears, melons,

etc?

"Bob Phillips" wrote:

Careful Andy,

OR((A1:A50="apples"),(A1:A50="grapes")) will evaluate to true if there

is
even one occurrence of apples or grapes in column A, and thus will count

all
occurrences of oranges in B. So Jim in A, oranges in B will count. Don't
think this is what is wanted.

Try instead.

=SUMPRODUCT(((A1:A10="apples")+(A1:A10="grapes"))* (B1:B10="oranges"))

or


=SUMPRODUCT(--((A1:A10="apples")+(A1:A10="grapes")),--(B1:B10="oranges"))

in my preferred style<vbg,

or most succinctly, and my preferred solution

=SUMPRODUCT(((A1:A10={"apples","grapes"}))*(B1:B10 ="oranges"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


<Andy wrote in message ...
Try this:

=SUMPRODUCT(OR((A1:A50="apples"),(A1:A50="grapes") )*(B1:B50="oranges"))

Andy.


"force530" wrote in message
...
Thanks ndy .. it works. What if I wanted to add grapes in column A

along
with
Apples?

"Andy" wrote:

Hi

Try something like:
=SUMPRODUCT((A1:A50="apples")*(B1:B50="oranges"))
I don't quite understand the "If this occurs on multiple rows, I

want
to
count them all as one sum." bit, but it's a start at least!

Andy.

"force530" wrote in message
...
I have two columns with lets say a range of 50 (a1:a50) and

(B1:B50).
I
want
to count the number of occurences when a specific arguement

occurs.
i.e.,
If
A23=apples and b23=oranges, I want to count this occurence, but

only
if
this
occurs together on the same row. If this occurs on multiple rows,

I
want
to
count them all as one sum.





  #3   Report Post  
force530
 
Posts: n/a
Default

This one doesnt work properly ...These are the conditions; If Column A has
either apples and/or grapes I would like them to be counted only if oranges
or pears are in the same row in column B. i.e., A5=apples or grapes and B5=
oranges or pears, then the condition is met and it should reflect 1.



"Bob Phillips" wrote:

=SUMPRODUCT(((A1:A10="apples")+(A1:A10="grapes"))* ((B1:B10="oranges")+(B1:B1
0="pears")))

--
HTH

Bob Phillips

"force530" wrote in message
...
It appears all of the solutions work ... thanks. How would I add multiple
aguements in column B, the same column as oranges, i.e., pears, melons,

etc?

"Bob Phillips" wrote:

Careful Andy,

OR((A1:A50="apples"),(A1:A50="grapes")) will evaluate to true if there

is
even one occurrence of apples or grapes in column A, and thus will count

all
occurrences of oranges in B. So Jim in A, oranges in B will count. Don't
think this is what is wanted.

Try instead.

=SUMPRODUCT(((A1:A10="apples")+(A1:A10="grapes"))* (B1:B10="oranges"))

or


=SUMPRODUCT(--((A1:A10="apples")+(A1:A10="grapes")),--(B1:B10="oranges"))

in my preferred style<vbg,

or most succinctly, and my preferred solution

=SUMPRODUCT(((A1:A10={"apples","grapes"}))*(B1:B10 ="oranges"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


<Andy wrote in message ...
Try this:

=SUMPRODUCT(OR((A1:A50="apples"),(A1:A50="grapes") )*(B1:B50="oranges"))

Andy.


"force530" wrote in message
...
Thanks ndy .. it works. What if I wanted to add grapes in column A

along
with
Apples?

"Andy" wrote:

Hi

Try something like:
=SUMPRODUCT((A1:A50="apples")*(B1:B50="oranges"))
I don't quite understand the "If this occurs on multiple rows, I

want
to
count them all as one sum." bit, but it's a start at least!

Andy.

"force530" wrote in message
...
I have two columns with lets say a range of 50 (a1:a50) and

(B1:B50).
I
want
to count the number of occurences when a specific arguement

occurs.
i.e.,
If
A23=apples and b23=oranges, I want to count this occurence, but

only
if
this
occurs together on the same row. If this occurs on multiple rows,

I
want
to
count them all as one sum.






  #4   Report Post  
Aladin Akyurek
 
Posts: n/a
Default



force530 wrote:
[...]
These are the conditions; If Column A has
either apples and/or grapes I would like them to be counted only if oranges
or pears are in the same row in column B. i.e., A5=apples or grapes and B5=
oranges or pears, then the condition is met and it should reflect 1.

[...]

=SUMPRODUCT(--ISNUMBER(MATCH($A$2:$A$10,{"apples","grapes"},0)),--ISNUMBER(MATCH($B$2:$B$10,{"oranges","pears"},0)))
  #5   Report Post  
force530
 
Posts: n/a
Default

Thanks for the reply ...

Okay here is the actual formula ... It will not add the "Filed-Arrest
Felony" when entered. The formula is accepted, but wont add the last part.

=SUMPRODUCT(--ISNUMBER(MATCH('OFFENSE LOG'!$F$7:$F$57,{"Murder","Capital
Murder"},0)),--ISNUMBER(MATCH('OFFENSE LOG'!$P$7:$P$57,{"filed-at large
felony","filed-arrest felony"})))


"Aladin Akyurek" wrote:



force530 wrote:
[...]
These are the conditions; If Column A has
either apples and/or grapes I would like them to be counted only if oranges
or pears are in the same row in column B. i.e., A5=apples or grapes and B5=
oranges or pears, then the condition is met and it should reflect 1.

[...]

=SUMPRODUCT(--ISNUMBER(MATCH($A$2:$A$10,{"apples","grapes"},0)),--ISNUMBER(MATCH($B$2:$B$10,{"oranges","pears"},0)))



  #6   Report Post  
force530
 
Posts: n/a
Default

It just doest seem to recognize the "filed-arrest felony"

"force530" wrote:

Thanks for the reply ...

Okay here is the actual formula ... It will not add the "Filed-Arrest
Felony" when entered. The formula is accepted, but wont add the last part.

=SUMPRODUCT(--ISNUMBER(MATCH('OFFENSE LOG'!$F$7:$F$57,{"Murder","Capital
Murder"},0)),--ISNUMBER(MATCH('OFFENSE LOG'!$P$7:$P$57,{"filed-at large
felony","filed-arrest felony"})))


"Aladin Akyurek" wrote:



force530 wrote:
[...]
These are the conditions; If Column A has
either apples and/or grapes I would like them to be counted only if oranges
or pears are in the same row in column B. i.e., A5=apples or grapes and B5=
oranges or pears, then the condition is met and it should reflect 1.

[...]

=SUMPRODUCT(--ISNUMBER(MATCH($A$2:$A$10,{"apples","grapes"},0)),--ISNUMBER(MATCH($B$2:$B$10,{"oranges","pears"},0)))

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
Conditional countif force530 Excel Worksheet Functions 6 July 1st 05 06:09 PM
countif conditional Ken Excel Worksheet Functions 1 June 15th 05 06:05 PM
Question on Conditional COUNTIF Question on Conditonal Countif Excel Worksheet Functions 2 February 13th 05 07:29 PM
Countif and Conditional Formatting Ramiro Espinoza Excel Worksheet Functions 1 February 2nd 05 05:21 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM


All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"