In B7:
=sumproduct(A2:A5,B2:B5)
does exactly what you describe in your question.
I don't know if Google Sheets has an equivalent.
In B7:
=sumproduct(A2:A5,B2:B5)
does exactly what you describe in your question.
I don't know if Google Sheets has an equivalent.