I would Use SUMIF(), you can look up exact formatting but basically =SumIf([column you want to check],[what you are checking for],[column to sum])
So in your example the simplest way would be create a new column and check for Column A = Primary(if(colum A=primary, 1,0) to be true, another column and use a =if(if(search (A,column B))>0,1,0) +if(search (C,column B))>0,1,0) +if(search (T,column B))>0,1,0) >0,1,0)
You can then add these columns and create a sum column to equal 1 if the value is >0, and then use the sumif function on this new column.