I have looked at your image, but cannot see what you are sorting. Tell us in words how you got to the right hand table, please.
I'll try to explain it. A retention time value represents one single chemical substance, so you can see the retention time column as a list of different substances. The Area column represents the quantity of these substances in a sample.
Columns Ret Time 1 and Area1 represent supstances and their quantities of the
first sample (reference sample), Ret Time2 and Area 2 of the
second one, and Ret Time3 and Area 3 of the
third one. My goal is to sort a single chemical substance (for example for alpha Pinene is the retention time in the range between 9625 to 9675) in one single row for all three samples. All ret. time values of the second sample (column AF) and all subsequent samples should be compared with the ret. values of the reference sample (column AD). If ret. time value of the sample 2 equals ref.value+-25, it represents the same substance and should be placed in the same row as the ret. time value of the reference sample, if not - the cell should be left blank.
On the example of alpha Pinene: The ret. time value of the first sample (reference sample) 9650 (column AK), of the 2. sample 9654 (AM) and of the 3. sample 9651 (AO) are placed in the same row together with the quantity values (Area value) of the alpha Pinene in each corresponding sample. The retention time values of the 2. (9654) and 3. sample (9651) are in the range 9650(ref.value) +-25, so the condition is fulfilled.
All other substances should be also sorted in this manner. Check whether ret. time value = ref. value+-25. If true > place in the same row, in not > leave blank.