This is a sheet design error.
You need an extra sheet of detail entries that gets summed by day in a separate sheet of =SUMIFS() formulas by those two key columns.
If the summary row is already there then you just skip adding it.
Look at my Marathon sample.