title: Excel: Group rows and add minimum and maximum from two different columns within the group
body: <p>I have the following excel table:</p>
  <pre><code>+-------+----------+------------+----------+
  | event | category | start-time | end-time |
  +-------+----------+------------+----------+
  | a     | Z        |          0 |        9 |
  | a     | Z        |          2 |       10 |
  | a     | Z        |          2 |       11 |
  | b     | Y        |          2 |        7 |
  | c     | X        |          3 |        8 |
  | c     | X        |          2 |        7 |
  | c     | W        |          4 |        8 |
  | c     | W        |          5 |       10 |
  +-------+----------+------------+----------+
  </code></pre>
  <p>I need to group the rows by event and category and then find the start and end-time of that event-group and finally calculate the time difference. Resulting in the following table:</p>
  <pre><code>+-------+----------+------------+----------+------+
  | event | category | start-time | end-time | time |
  +-------+----------+------------+----------+------+
  | a     | Z        |          0 |       11 |   11 |
  | b     | Y        |          2 |        7 |    5 |
  | c     | X        |          2 |        8 |    6 |
  | c     | W        |          4 |       10 |    6 |
  +-------+----------+------------+----------+------+
  </code></pre>
  <p>Is there an elegant solution, without using VBA?</p>