Count if cells contain a specific text in Excel and Google Sheets

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

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

A2:A7 & A:A = ranges

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