Extracting data from a column using look up

I am trying to get the formula that extracts the membership numbers from any cancellations from column F into column U Cancellations show in column O as 14DMB.

I have inputted the data manually and circled what I want it to do to demonstrate easier. In the example given, there are two cancellations.This should continue to extra cancellations when sales are added.

Any support would be appreciated, thank you.

enter image description here