Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default Using COUNTIF and OR

I know COUNTIF isn't the right function because I know it cannot use logic
operators. Here's what I am trying to accomplish:

Col A Col B
A 5
B 6
C 3
A 3
A
B 7

The question is, how many numbers in Column B correspond to EITHER A or C?

Recommendations?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default Using COUNTIF and OR

See if this works for you:

=SUMPRODUCT((A1:A6="A")+(A1:A6="C"),--(ISNUMBER(B1:B6)))

HTH
Elkar


"Janie" wrote:

I know COUNTIF isn't the right function because I know it cannot use logic
operators. Here's what I am trying to accomplish:

Col A Col B
A 5
B 6
C 3
A 3
A
B 7

The question is, how many numbers in Column B correspond to EITHER A or C?

Recommendations?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Using COUNTIF and OR

I depends on what you mean by "correspond to". Regardless, an "or" condition
involves simple addition. Try:

To count the occurrences:
=countif(a:a,"A")+countif(a:a,"C")

To sum column B if:
=sumif(a:a,"A",b:b)+sumif(a:a,"C",b:b)

Regards,
Fred.

"Janie" wrote in message
...
I know COUNTIF isn't the right function because I know it cannot use logic
operators. Here's what I am trying to accomplish:

Col A Col B
A 5
B 6
C 3
A 3
A
B 7

The question is, how many numbers in Column B correspond to EITHER A or C?

Recommendations?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Using COUNTIF and OR

try this after changing columns to suit
=SUMPRODUCT((H2:H22={"a","b"})*(I2:I220))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Janie" wrote in message
...
I know COUNTIF isn't the right function because I know it cannot use logic
operators. Here's what I am trying to accomplish:

Col A Col B
A 5
B 6
C 3
A 3
A
B 7

The question is, how many numbers in Column B correspond to EITHER A or C?

Recommendations?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Using COUNTIF and OR

=SUM(SUMIF(A1:A10,{"A","B"},B1:B9))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Janie" wrote in message
...
I know COUNTIF isn't the right function because I know it cannot use logic
operators. Here's what I am trying to accomplish:

Col A Col B
A 5
B 6
C 3
A 3
A
B 7

The question is, how many numbers in Column B correspond to EITHER A or C?

Recommendations?




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 Use larryf666 Excel Worksheet Functions 4 November 24th 06 12:49 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


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