How to sum the values on the basis of the dropdown option

I am having the following table where I have 3 options in dropdown. As per choice I want to show the sum in another table. Please find the example below



Thank you so much. Also, the way you used the formula. Is there any alternative to if condition as I am having multiple conditions?

SwitchIf() might be an option for you. You can read about it here:

Also, take note of the other types of formulas documented on that page, for future reference.