As I understand you want sum of values according to dates if dates are changed then values should be changed automatically. I have answer for this '=SUMPRODUCT((B2:AF2>=B24)*(B2:AF2<=B25)*B3:AF3)'. Use this formula in your sheet First select the rows where your dates are present and match it with starting date or end date which is written in your sheet on B24 or B25. when you do change in date at B24 or B25 it will automatically update the values in total value cell.