Search code examples
excelexcel-formulaworksheet-functioncountif

Combined COUNTIF for several columns


We have a table with values like this:

enter image description here

I need a formula for cell D1 to count rows that have in column A value "one" and column B is not empty. For example:

  • in first row A1==one but B1 is empty; (that doesn't count)
  • in second row A2==one and B2 is not empty; (that counts 1)
  • ...
  • in 4th row A4 is not equal to value "one" (that doesn't count)

I know about formulas like COUNTIF and COUNTIFS but I can`t figure out how to use them with combined condition.


Solution

  • Please try:

    =COUNTIFS(A:A,"one",B:B,"<>")