title: Range sum using regex
body: <p>I have a spreadsheet with data as follows:</p>
  
  <pre><code>    |A    |B       |C       |D       |
  +---+-----+--------+--------+--------+
  |1  |Day  |Result 1|Result 2|Result 3|
  +---+-----+--------+--------+--------+
  |2  |Feb 1|A10-2   |B10-5   |B10-9   |
  +---+-----+--------+--------+--------+
  |3  |Feb 2|A10-9   |A10-9   |        |
  +---+-----+--------+--------+--------+
  |4  |Feb 3|B10-8   |A10-2   |B10-7   |
  </code></pre>
  
  <p>I want to get the sum of the second digit in each cell, in two totals based on the first letter. In other words, I want a sum of the second digit where the first letter is <code>A</code>, and a sum of the second digit where the first letter is <code>B</code>.</p>
  
  <p>So, for <code>A</code> I am expecting to get <code>22</code> (2+9+9+2), and for <code>B</code> I am expecting to get <code>29</code> (5+9+8+7).</p>
  
  <p>I have used <code>REGEXEXTRACT</code> to get the second digit, for example:  </p>
  
  <pre><code>=REGEXEXTRACT(B2,"A10-(\d+)")  
  </code></pre>
  
  <p>this gives me <code>2</code>. However, if I try:  </p>
  
  <pre><code>=REGEXEXTRACT(B2:D4,"A10-(\d+)")  
  </code></pre>
  
  <p>to check all cells, I get <em>an array value could not be found</em> and I'm not sure what else to try.</p>
  
  <p>Pseudocode for what I want would be something like:  </p>
  
  <pre><code>=SUM(REGEXEXTRACT(B2:D4,"A10-(\d+)"))  
  </code></pre>
  
  <p>but I'm not sure if this is possible.</p>