google sheets – How to use arrayformula to search and extract data from a certain set of dynamic columns?

I have a table where my headers are generated dynamically from another source and can appear with any header values, in any order.

In the example below, I have the header values:

AA - BB - CC - ABBA - KK - VV

but it could have been:

CC - AA - QQ - AA

I do not know in advance which headers I will get, nor how much.

My problem is that I want to add up all the product values, using a matrix formula, where the column headers include for example "BB".

So basically = arrayformula (sumes (C4: H1000, $ C $ 3: $ H $ 3, "* BB *"))if it had been a thing.

My closest assumption is that I have to use a VLOOKUP of some sort, but since the index of the columns to extract the data is not static, I can not really understand how to solve it.

Desperate for help.

enter the description of the image here