Calculate average of similar rows cell in Excel

Please find the below example to edit the values in datatable.