Excel data summary problem

Hello everyone,
I have a question to ask everyone. As a novice, the handling of Excel is not very clear. I have a table with many columns, such as the third column, when 111 = 111, and the fourth The calculation is only performed when column A=A. For example, when 111=111 in the third column and B=B in the fourth column, it means that when I want to calculate 111=111, A, B, C, D points Based on the summary value, write the result in column 15 and mark it at the end of the last occurrence.
I really don’t have any ideas, I hope you can provide me with ideas, and I’m grateful.
Below I will attach my file, please help to find a way.
Test.xlsx (9.0 KB) Result.xlsx (9.6 KB)

I used sorting, but what should I do next。

Really happy automation, this is too difficult for me