Count cells that contain a specific text and ignore blank in Excel/Sheets

=COUNTIF(A2:A6,"*apple*") // criteria within formula

=COUNTIF(A:A,"*"&C6&"*") // criteria as a cell reference

A2:A6 & A:A = Ranges; C6 = criteria

Check below for a detailed explanation with pictures and how to use formulas in Excel and Google Sheets.