Forum Discussion

Armanda406's avatar
Armanda406
Copper Contributor
Mar 22, 2019
Solved

Trying to figure out if I use CountIF, CountIFs with multiple criteria and logic.

I am trying to figure out if a region/section in the column is blank or not. It's in order by region but each region can be listed multiple times, so, for example, SEC36 is on the list 30 times, but ...
  • SergeiBaklan's avatar
    SergeiBaklan
    Mar 23, 2019

    PeterBartholomew1 , IMHO the main question here is what we consider as empty cell. That could be the blank cells (no content at all) only, or blank cells and cells with empty string ("", which we usually use to imitate blank cells). If do small test we will see the difference

    Here two yellow cells are with empty string and one cell is blank. Total 6 cells, 2 empty plus 1 blank.

    COUNTA() doesn't consider cells with empty strings as blank and count them, same do COUNTIFS(). Just in case, COUNTBLANK() in opposite counts both blank and empty ans blanks. SUMPRODUCT() does correct calculations excluding all cells with empty strings and blank ones. Variant with LEN() is more straightforward and gives less reasons for misinterpretations.

    As for @ that's not wildcard, only the character which is more close to the beginning of ASCII table compare to other characters. However, # is even earlier plus any number is always less than any text, thus formula counts only the cell with a1.

     

    Back to initial question I'd use SUMPRODUCT like

    =SUMPRODUCT((B2:B206="SU036")*(LEN(E2:E206)>0))

     

Resources