Hello Find attached!!
I think because of less data formula is not giving the expected results(As shown by you below the calculation part). Try this formula with your actual data and get back if there is any problem,
I have formatted your sheet to keep only one formula, In your actual sheet format as same then drag across and down.
excelhelp (1).xlsx
Bookmarks