I've attached an example below. I have a large sheet similar to Raw Data table from the image. My goal is to count unique occurrences based on the first column (ID) of the Results table.
In the Raw Data table, the ID consists of the main ID and its sub ID. I want to use the main ID from the Results table as a reference to essentially count how many occurrences of that main ID there are from that Raw Data table.
However, there are some duplicate IDs in the Raw Data table. I only want to count the ones in the green (i.e. the last occurrence) and not count the first occurrence in red. In this example, there are only 2 duplicates, but there might be 3 duplicates as well.
Lastly, I want to add the Price from the Raw Data table with the same main ID as shown in the Total column of the Results table.