There are two ideas to solve this problem (fill in the code in cell D1):
1. Search and filter in adjacent intervals: directly search forward and backward without changing the order of data. Once the row of the first product with the same name is found, it is the sales of the previous selling day/next selling day.
2. Take the value of adjacent rows within the same group: group the data by product, and take the value of the previous row/the next row within the group directly, which is the sales of the previous selling day/next selling day.