I am looking for a way on how to manipulate values in the table, for example I am getting the following report

and I would like to sum variable 'count' for XX and YY, when Type is equal to B and "null" (empty cell )
so the resultant table should be like one below (35+16 for XX = 51, and 14+21 for YY =35)

Thanks a lot for any suggestions on how to achieve that
Regards,
Dam