Need help to add list of counts in cell

I’m trying to filter the data of two types and show it’s count in cell.
Like I have different Cardboard boxes of different sizes and want to categories them by their size and want to show their quantity in single cell.

Hi! You will have to use

:grouped by

Thanks I got it.