Enter as an Array, Ctrl-Shift-Enter instead of Enter

=SUM((C11:D18="vending commission inhouse")*(F11:F18))

of course you can refer to a cell containing the text instead of typing "vending commission inhouse"