Can I use a filter to sum a group of noncontiguous cells?

I would like to use a category column that will hold a value that I can use for a filter when summing a range of cells in another column that have numerical values. Is that possible?

Please detail a bit how data are disposed?

What about?
=SUMIF(CategoriesRange;Criterion_FilterValue;ValuesRange) or
=SUMPRODUCT(ValuesRange;CategoriesRange=Criterion_FilterValue)
(Corresponding ranges dimenioned identically!)
Consult help texts. Also AVERAGEIF, SUMIFS, AVERAGEIFS… Most versatile is SUMPRODUCT.