Sum total sales based on quantity & price in Excel and Google Sheets

=SUMPRODUCT(A2:A5,B2:B5)

A2:A5 = quantity range; B2:B5 = price range

Check below for a detailed explanation with pictures and how to use formulas in Excel and Google Sheets.