SUMIF cells if contains part of a text string in Excel and Google Sheets

To sum based on a condition you can use the SUMIF function, for i.e =SUMIF(A2:A4,"Germany",B2:B4) where A2:A4 = criteria_range; B2:B4 = sum_range.

=SUMIF(A2:A4,"3PIE",B2:B4) // criteria within formula

=SUMIF(A2:A4,C5,B2:B4) // criteria as a cell reference

A2:A4 = criteria_range; "3PIE" = criteria; B2:B4 = sum_range

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