Hello and welcome to the forum
Try Sumifs