Product code consists of five letters. A report should count sales for any product codes which include at least one H letter.
Random product codes I have created with following function:
=CHAR(RANDBETWEEN(65;85)) & CHAR(RANDBETWEEN(65;85)) & CHAR(RANDBETWEEN(65;85)) & CHAR(RANDBETWEEN(65;85)) & CHAR(RANDBETWEEN(65;85))
And sales :
=RANDBETWEEN(1;100)
If any of five letters is H, then the report should count the sales for that product.
I have solved this issue with SEARCH-function.

Search function returns value if the text to be found was found.

To differentiate the two results, you can use ISERROR function. The function returns value based on whether the cell contains an error.
If SEARCH function finds a value, the result is not an error. If SEARCH does not find the value, then the result is an error.
Now we can build the formula to solve the issue.
=IF(ISERROR(SEARCH(“H”;C5));””;”H here”)
The letter H is search in the cell C5. If the result is an error, there is not H in cell C5, then the result is blank. If SEARCH finds an H in C5, then the result is not an error, and IF returns the value H here.
The records, where H exist, are marked with H here text. Now we should count the sum for H here records.
=SUMIF(E5:E28;”H here”;D5:D28)
E-column holds the IF function to check H letters, D-column is for the sales volumes.






