Hey,
=SUMPRODUCT(($C$2:$C$6="brand 1")*($M$2:$M$6))
Assuming brand names in Col C (rows 2 - 6) & the quantity in Col M (rows 2 - 6)
NB: You can change "brand 1" to be more dynamic by making a cell as "brand 1" and referencing the cell.
Like
C D E F G H I J K L M N O P 2 c m 3 brand 1 2 brand 1 5 4 brand 4 1 brand 4 2 5 brand 4 1 brand 7 1 6 brand 1 3 7 brand 7 1
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>Sheet1
Worksheet Formulas
Cell Formula P3 =SUMIF(C:C,O3,M:M)
<thead>
</thead><tbody>
</tbody>
<tbody>
</tbody>