Function structure:
= sum.if ('range with conditions', 'condition', 'values to sum')
'range with conditions' - indicate the data area in which our criterion is located, on the basis of which the function is to sum up (A2: A19)
'condition' - what value must the function meet to return the result of summation (F1 - reference to the cell value. In the future, just change its value to summarize another segment)
'values to be added' - what we want to sum up (B2: B19 - sale)
An example of using the formula in practice: