=SUMIF(C3:C7,"*Oil and gas*",D3:D7) // a text criteria within formula must be inside quotation marks " "
=SUMIF(C3:C7,"*"&B11&"*",D3:D7) // criteria as a cell reference
C3:C7 = criteria_range
"*Oil and gas*" = criteria
D3:D7 = sum_range
=SUMIF(C3:C7, "Oil and gas", D3:D7) this will return 0 value in the above data set
💡 Wildcard: The * character allows for any number (including zero) of other characters to take its place.
💡 In this example, it’s used to find all cells that include the text "Oil and gas". This search is not case-sensitive, so "Oil and gas" are considered the same as "OIL AND GAS" or "Oil And Gas".
💡 Access the Google Sheets here used in this exercise. All functions on this page are compatible with Microsoft Excel and the same analysis can be made in Excel
💡 Below explained, how to sum if a text contains part of the string