title: Query data in google spreadsheet and format resulting columns
body: <pre><code>       A        B      C      D       E     F      G       H          I       
     +--------+------+-------+------+-------+---+---------+------+--------------+
   1 | Select | Name | Price | URL  | Desc  | - | Select  | Name | Price(13.97) |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   2 | x      | n2   | 4.99  | url2 | desc2 | - | x       | n2   | 4.99         |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   3 |        | n3   | 3.99  | url3 | desc3 | - | x       | n6   | 3.99         |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   4 |        | n4   | 7.99  | url4 | desc4 | - | x       | n9   | 4.99         |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   5 |        | n5   | 4.99  | url5 | desc5 | - |         |      |              |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   6 | x      | n6   | 3.99  | url6 | desc6 | - |         |      |              |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   7 |        | n7   | 4.99  | url7 | desc7 | - |         |      |              |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   8 |        | n8   | 3.49  | url8 | desc8 | - |         |      |              |
     +--------+------+-------+------+-------+---+---------+------+--------------+
   9 | x      | n9   | 4.99  | url9 | desc9 | - |         |      |              |
     +--------+------+-------+------+-------+---+---------+------+--------------+
  </code></pre>
  
  <p>Given the table above <code>A1:E9</code>, I want to generate the result shown in columns <code>G:I</code></p>
  
  <p>I succeeded getting a similar result  (without the parethesis and their value in <code>I1</code>) using in <code>G1</code> this formula:</p>
  
  <pre><code>=Query(A:E, "SELECT A, B, C WHERE A CONTAINS 'x' ORDER BY B ASC",1)
  </code></pre>
  
  <p><strong>The question is:</strong> How to add the sum of the selected rows to the header of the last column as shown in the example?</p>
  
  <p>Thank you in advance :)</p>