hello, if anyone has few minutes to spare, i would really appreciate some help

this picture will explain what i need

\1

1st part is to sum all the values in type3 row. but the problem is how to find out all the values in type4 that have a corresponding type2 value = 8 on the same day (same column).

ty in advance