Try:
=SUM(IF(LEFT(D6:Q6)="a",MID(D6:Q6,2,2)+0))

which must be confirmed with CTRL+SHIFT+ENTER not just ENTER. You will see { } brackets appear...then you can copy down the formula.