A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Try
=SUMIFS(Sheet2!D1:D99,Sheet2!C1:C99,A1,Sheet2!D1:D99,"<6")
Note that the functions is sumifS
if you want to include 6 then use
=SUMIFS(Sheet2!D1:D99,Sheet2!C1:C99,A1,Sheet2!D1:D99,"<=6")
to check for the range 4.75 to 6 (both inclusive) use
=SUMIFS(Sheet2!D1:D99,Sheet2!C1:C99,A1,Sheet2!D1:D99,">=4.75",Sheet2!D1:D99,"<=6")