averageif based on form response



Had a quick question I haven't been able to find a solution to.

I need to average a column based on a different column containing part of a name.

So for instance a facility will do the survey and I need to average their response to a question. The facility may be put in a number of ways, but always contain "pittsburgh" for example. So I have tried:

=AVERAGEIF({Survey Range},CONTAINS("pittsburgh", {KPI Survey Range 11}))

where the first reference is the range to average and the second is the range to lookup the name in. However, this gives me the average for the total range, including other facility's answers. Any help is appreciated.