Valency represent the outermost electron present in any atom. it tells us the capacity of an atom to lose or gain the electron. All elements have almost fixed valency except transition metals. lets have a look on valency table
The chemical formula represent the symbol of elements and ratios of elements to one another in a compound. It tells how many present in each compound for example if we talk about water, it contains 2 Hydrogen atoms and 1 Oxygen atom. Chemical formula of water