Forum Discussion

Chris Mercado's avatar
Chris Mercado
Copper Contributor
Nov 16, 2017

COUNTIF "or" RANGE

So, I have created a formula with multiple "COUNTIF" functions over varied ranges.  However, for a few cells within the formula, I only want the formula to count one cell or the other, but never both.  So, for example, =COUNTIF(E17,">0")+COUNTIF(E24,">0") would count both cells and spit out "2".  However, I cannot figure out how to tell it to count 1 or the other but never both.  So, if E17's value was greater than 0, but E24 = 0 (or vice versa), I want it to equal 1.  If both cells values are 0, then I want it to equal 0.  However, if both E17 and E24 are greater than 0, I still want the formula to equal 1, not 2.  Does that make any sense?

  • Hi Chris,

     

    If we speak about single cells, not ranges, that could be

    =--OR(E17>0,E24>0)

     

    • Chris Mercado's avatar
      Chris Mercado
      Copper Contributor

      Thanks, that looks like it works, even incorporated with the rest of my COUNTIF formula for other cells...

Resources