Doesn't sound complicated but I still don't see expected result from your example. Don't even know what is in A1, A2... And do you take in C column from B column or A column.