Use SUMIF function
Learn more