0
votes

How to write Countif function with selecting discrete range of cells, I mean the range cannot be written as (A:B), they are not adjacent.

I wrote the following function, but it is showing me #Value!

COUNTIF((F7,I7),">0")

2

2 Answers

0
votes

Use Countifs() function as following

=COUNTIFS(F7,">0",I7,">0")
0
votes

COUNTIF Versions

=SUM(COUNTIF(F7,">0"),COUNTIF(H7,">0"))
=IF(OR(COUNTIF(F7,">0"),COUNTIF(H7,">0")),1,0)
=IF(AND(COUNTIF(F7,">0"),COUNTIF(H7,">0")),1,0)
  1. If both cells are greater than 0, the result is 2.
    If either one of the cells is greater than 0, the result is 1.
    If no cell is greater than 0,the result is 0.

  2. If both cells are greater than 0, the result is 1.
    If either one of the cells is greater than 0, the result is 1.
    If no cell is greater than 0, the result is 0.

  3. If both cells are greater than 0, the result is 1.
    If only one of the cells is greater than 0, the result is 0.
    If no cell is greater than 0, the result is 0.