Hi and welcome to the forum.

Try this

=SUMIF(B1:B6,"=a",A1:A6)

Hope it helps you.