如何根据多个列值获取不同行组合的计数?

How to get count of different row combinations based on multiple column values?

如何打印出不同种类产品变化的数量?

ColumnB 的下拉菜单具有以下值:红色、蓝色、绿色
ColumnC 的下拉菜单具有以下值:正方形、圆形
ColumnD 是计数

行数可以是例如200 到那件事

对于示例输出信息应该是:
红方块 7
红圈3
蓝色方块 5

ColumnA       | ColumnB       | ColumnC       | ColumnD  
-------------------------------------------------------  
Customer name | Product color | Product shape | Count  
-------------------------------------------------------  
John Doe      | Red           | square        | 2  
John Doe      | Red           | circle        | 3  
Mary Doe      | Blue          | square        | 5  
Mary Doe      | Red           | square        | 5  

尝试:

=ARRAYFORMULA(QUERY({B:B&" "&C:C, D:D}, 
 "select Col1,sum(Col2) 
  where Col2 is not null 
  group by Col1 
  label sum(Col2)''"))