?
Solved

counting occurances relative to another column

Posted on 2011-10-30
1
Medium Priority
?
216 Views
Last Modified: 2012-06-21
Hi,

I have 2 columns of data next to each other, and they are lined up so i have column A which is decimal number and column b has a key word in it (either "good" or "bad")

I want to find whether the number in column A is between 0.5 and 1, also whether the keyword in the other column is "bad"

So far i have this to find the numbers beween a certain range:

=COUNT(A:A)-COUNTIF(A:A,"<0.5")-COUNTIF(A:A,">1")

But im not sure how to find if the keyword in the second column is equal to "bad"
0
Comment
Question by:jayfletcher
1 Comment
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 37055321
Try SUMPRODUCT, i.e.

=SUMPRODUCT((A$2:A$100>=0.5)*(A$2:A$100<=1)*(B$2:B$100="Bad"))

In Excel 2003 and earlier you can't use whole columns in SUMPRODUCT so I restricted the range - change as required.

In Excel 2007 and later you can use COUNTIFS (with an "S"), i.e.

=COUNTIFS(A:A,">=0.5",A:A,"<=1",B:B,"Bad")

regards, barry
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question