do you have multiple entries in column A
if No,
1> use the SUM($B2:$E2) for Q1 and SUM($F2:$I2) for Q2 and drag them down, and put O2=A2. you will get the list in same order...
If Yes, then I have a bit lengthy solution.
For Q1 use SUMIF($A:$A,Q2,$B:$B)+SUMIF($A:$A,Q2,$C:$C)+SUMIF($A:$A,Q2,$D:$D)+SUMIF($A:$A,Q2,$E:$E)