I will explain this the best I can.

I have a data sheet extracted with SQL. My goal is to calculate the average of certain cells in a column. There is a condition that the row which the cell is in contains a specific letter such as "B".

I'm dealing with building permits and they all have an id with the form: "12-3456-12-B". The letter resembles the type of permit and that's how I want to divide my averages. In the column I wish to extract the averages from is a percentage that resembles the degree of repair on the said permit.

So what I want is to have an average degree of repairs on individual permit types.

On a logical perspective: "Use the value if Cell B in current row contains i.e. "-B""

Cheers!