excel count number of cells which contain text code example Example: excel count columns with text =COUNTIF(B4:B8,"*")