I am quite new to excel and therefore I need some help!

I have 2 sheets. On the 1st sheet is one column with company names, and 2 columns with dates. On the next sheet are daily returns of these companies: company names in the first column, with the daily return of the company horizontally next to it arranged by date. On top there is a line with the individual dates corresponding with the daily returns.

What I want to do is take the 2 dates in the first sheet, and sum up the corresponding daily returns of the stocks in the 2nd sheet. It has something to do with the Sumif function if I'm correct but I cannot figure it out. I was not able to find anything on the excelguru forum with this specific problem!