A compound is a substance made up of a definite proportion of two or more elements. A chemical formula tells us the number of atoms of each element in a compound. It contains the symbols of the atoms of the elements present in the compound as well as how many there are for each element in the form of subscripts.
eg:Aluminium sulfate has the chemical formula Al2(SO4)3.
So by writing such chemical formulas ,we can find how many atoms of each type present in a particu;ar compound.
For above compound it contain 2 atoms of Al(Almunium) ,3(3*1) atoms of S(Sulphur),12(3*4) atoms of O(oxygen).