Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Appleton, Wisconsin, USA
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    counting unmet criteria (2000-2003)

    I would search for this answer, but I'm not sure what search terms to use!

    Is there a straightforward way to total the number of times a value in one column is less than the corresponding value of another?

    I'm attaching a dummy spreadsheet where I highlighted the cells that I would want counted. Any ideas?
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: counting unmet criteria (2000-2003)

    Does this formula do what you want?
    <code>
    =SUMPRODUCT(--(B2:C8<A2:A8))</code>

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Appleton, Wisconsin, USA
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: counting unmet criteria (2000-2003)

    Yes! Perfectly. So now I'm curious: how does it work? What does the "--" do?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: counting unmet criteria (2000-2003)

    The result of B2:C8<A2:A8 is an array of TRUE/FALSE values.
    In Excel, TRUE corresponds to 1 and FALSE to 0, but you can't use them like that directly. The first - before (B2:C8<A2:A8) forces the TRUE values to become the number -1 and the FALSE values to 0. The second - converts the -1's to 1.

    You could also have used SUMPRODUCT(1*(B2:C8<A2:A8)). Here, the TRUE/FALSE values are converted to numbers by multiplying them with 1.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Appleton, Wisconsin, USA
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: counting unmet criteria (2000-2003)

    Excellent - thank you so much for the explanation!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •