Zend certified PHP/Magento developer

How do I summarize a value according to multiple columns in Excel?

Summing a column according to one other column is quite easy with a Pivot table. However, it doesn’t seem to be possible with multiple columns.

Similar to R’s group by, I want to summarize one value (in my case min) when values in multiple columns are the same. In essence, I want to convert the following table

table 1

into this table (here, using sum):

table 2

How do I do that, either using Pivot Tables or formulas?