• Using COUNTIF on cells with formulas

    Author
    Topic
    #465785

    I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

    TIA

    Viewing 24 reply threads
    Author
    Replies
    • #1199528

      I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

      TIA

    • #1199963

      I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

      TIA

    • #1200719

      I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

      TIA

    • #1201638

      I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

      TIA

    • #1202409

      I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

      TIA

    • #1203282

      I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

      TIA

    • #1204123

      I am trying to count the number of cells in a column that contain the number 1. However, the cells being counted are actually formulas and if you PasteValues on the column most of the cells displaying a 1 are actually less than 1 or greater than one but less than 2. I think the formula needs to take the actual values into consideration. Something like, countif(value(range,”>0″)+countif(value(range,”<2")))). I have something just not right because Excel doesn't like the formula. What am I not seeing?

      TIA

    • #1198405

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

      • #1205285

        Steve, the formula works fine for counting all the 1s but now I need to count all the 2s, then the 3s, 4s, and 5s. I had to modify the formula because of rounding so the working formula is
        =COUNTIF(K5:K161,”>0″)-COUNTIF(K5.K161,”>1.4″)
        Do I need to use AND with the COUNTIF in order to just get the 2s?

        TIA

    • #1199535

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

    • #1199967

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

    • #1200723

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

    • #1201642

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

    • #1202413

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

    • #1203289

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

    • #1204127

      How about this:
      =COUNTIF(range,”>0″)-COUNTIF(range,”>=2″)

      Steve

    • #1198412

      That did it. Thanks Steve.

    • #1199557

      That did it. Thanks Steve.

    • #1199974

      That did it. Thanks Steve.

    • #1200730

      That did it. Thanks Steve.

    • #1201649

      That did it. Thanks Steve.

    • #1202420

      That did it. Thanks Steve.

    • #1203301

      That did it. Thanks Steve.

    • #1204134

      That did it. Thanks Steve.

    • #1205310

      Making just a slight change to Steve’s formula…

      =COUNTIF(range,”>=2″)-COUNTIF(range,”>=3″)

      Should return the number of values that are greater than or equal to 2, while being less than 3. Is that what you needed?

    • #1205333

      If you want to count the rounded values, you could try:
      =SUMPRODUCT(–(ROUND(K5:K161,0)=2))

      • #1205471

        Rory and Ricky, both formulas work but the one using ROUND seems easier since I can just use whole numbers. Thank you both very much.

    Viewing 24 reply threads
    Reply To: Reply #1203282 in Using COUNTIF on cells with formulas

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel