excel how to count cells which contain some string code example Example: excel count columns with text =COUNTIF(B4:B8,"*")