Sum alternate columns based on criteria and header. I tried to transpose the data range also without luck.

Sum alternate columns based on criteria and header. sum of b3 to c5 based on headers A1 and A2.