You can combine the functions IF, ISERROR and FIND to get the result you want.
For example:
=IF(ISERROR(FIND("payroll",A3)),0,SUM(0,1,2,3,4))
The formula will look for the sub-string in the text. If it does not find it, it will return an error message. The ISERROR will detect this, in which case the sum will not be calculated and the formula will return 0 instead.
Note that the FIND function is case-sensitive. Of course, you need to replace the argument of the SUM function with what you want to sum.
Let me know if it does not help.