I have a problem with joining two columns based on related city and country names in google sheets or in excel maybe (if that helps)
Columns O is the name of the cities and column P is the country names
I want to join the cities to the related countries and add a character in between like | separated by comma's
so the result would be like Buenos Aires | Argentina, Lima | Peru, ..... in the corresponding rows
Example: Google Sheets Demo
how am I able to do that?

