counting occurances relative to another column

Posted on 2011-10-30
Last Modified: 2012-06-21

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:


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

    Accepted Solution

    Try SUMPRODUCT, i.e.


    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.


    regards, barry

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
    What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now