Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2007
    Location
    Gray, Louisiana, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Counting Formula Results (2003 2007)

    I have a formula
    =IF(AND($H11>0,$H11<10),"True","False")
    This returns a result of True or False based on the value in a cell.
    This formula fills down a column. It works fine.
    Now I need to count, with a separate formula, the number of "True" values returned.
    I tried =COUNTIF(S11:S339,"=TRUE") =COUNTIF(S11:S339,="TRUE") =COUNTIF(S11:S339,"TRUE") =COUNTIF(S11:S339,TRUE)
    None of which work, What am I doing wrong???
    thanks

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

    Re: Counting Formula Results (2003 2007)

    Assuming that you entered the formulas in S11:S339, the formula
    <code>
    =COUNTIF(S11:S339,"True")
    </code>
    should work. In what way does it fail?

    I would simplify the formula in S11 to
    <code>
    =AND(H11>0,H11<10)
    </code>
    and fill down to S339. You should then be able to use
    <code>
    =COUNTIF(S11:S339,TRUE)
    </code>
    (no quotes around TRUE)

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

    Re: Counting Formula Results (2003 2007)

    If you would like to omit the column of intermediary results S11:S339, you can use this formula to count the number of entries in H11:H339 that are greater than 0 and smaller than 10:
    <code>
    =SUMPRODUCT((H11:H339>0)*(H11:H339<10))</code>

  4. #4
    2 Star Lounger
    Join Date
    Jan 2007
    Location
    Gray, Louisiana, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Formula Results (2003 2007)

    The formula failed by returning a zero.
    I will try your suggestions.
    As a quick fix I changed the values from True and False to 1 and 0 then the formula was able to count properly

    thanks a lot for your help

  5. #5
    2 Star Lounger
    Join Date
    Jan 2007
    Location
    Gray, Louisiana, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting Formula Results (2003 2007)

    That "=sumproduct" formula is the real ticket, thanks again!!

Posting Permissions

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