The compound formed by chlorine and barium is as the number of valence electrons in barium is 2 and in chlorine is 1. In this compound, barium acts as a cation and chlorine acts as an anion. The formation of the compound is as shown in the image.
Since, barium is an element of Group-2 (alkaline earth metal) so the other element that has a chemical formula most and least similar to the chemical formula of the compound formed by chlorine and barium should be from Group-2 (alkaline earth metal) only which has properties somewhat like barium. So, the element is strontium.
Strontium forms a compound with formula in which strontium acts as a cation and chlorine acts as an anion. The formation of the compound is as shown in the image.