The ability of an element to attach atoms is called the valence of chemical elements. Valence helps to correctly place the indices of elements in formulas.
What is it?Any element is made up of atoms. An atom is the smallest particle formed by a positively charged nucleus and electrons orbiting the nucleus. Electrons move at different levels. The number of levels of a particular element corresponds to the period of the periodic table.

There are a number of electrons on the outer energy level. It is these electrons that are able to form covalent chemical bonds and attach to themselves an equal number of electrons of another element.

The number of atoms is equal to the number of chemical bonds. There cannot be more than eight electrons on the external energy level, therefore the valence changes from I to VIII.

Do not confuse valence and oxidation state. Valence indicates the number of attached atoms, oxidation - the conditional charge that an element receives when giving or accepting electrons. The oxidation state does not depend on the type of ionic bond and can be positive, negative or zero.
How isRemembering how many atoms are on the outer energy level of each element is optional. It is enough to use the table of valence of chemical elements or be guided by the periodic table of Mendeleev. The group number, indicated by a Roman numeral, indicates the highest valence of an element - the maximum number of chemical bonds.
Some elements have two or three valencies. This is due to the fact that an atom can pass into an excited state and form additional bonds. Sulfur can exhibit II, IV or VI valence, depending on the compound:
The electronic configuration of sulfur is 1s22s22p63s23p4. 
At the outer p-level there are four electrons, two of which are unpaired, therefore sulfur in the usual state is divalent. In an excited state, one of the paired electrons goes over to an empty d-sublevel. The atom is capable of forming four bonds, so the valency of sulfur becomes IV. Upon further excitation, one of the paired electrons of the 3s level is transferred to the d-sublevel in addition to the electron from the p-level. As a result, six electrons become unpaired, and sulfur exhibits the highest valence - VI.
Constant valence is characteristic of metals of the main subgroups and some non-metals. These include:
hydrogen (I);oxygen (II);lithium (I);beryllium (II);boron (III);fluorine (I);sodium (I);magnesium (II);aluminum (III);potassium (I);zinc (II);calcium (II).
Inert gases are chemically inactive. Therefore, it is generally accepted that their valence, regardless of the number of atoms at the external level, is equal to zero.
Why is it usedValence is important when formulating formulas. With the help of valency, the indices of the elements are put down, and if there are indices, it is easy to determine the valency of the elements.To determine the indices, you must proceed according to the following algorithm:

determine the valence of the elements in the formula (P - V, O - II);find the smallest multiple of valencies (5 ? 2 = 10);alternately divide the multiple by the valencies of the elements (10/5 = 2, 10/2 = 5);write down the corresponding symbols (P2O5).
If the formula is known, then the variable valence of the element can be determined. In the formula Fe2O3, the oxygen valence is 2. It is necessary to multiply the valence value by the oxygen index and divide by the iron index: 2 ? 3/2 = 3. Iron valence - III.
Valence indicates the number of possible chemical bonds with another element, or the number of atoms that an element can attach. The highest valence is easy to determine from the periodic table - its value corresponds to the element group. Elements can have one or more valencies. The ability to change the valence is associated with the excited state of the element. Using valence, you can calculate indices in chemical formulas and determine the variable valence of an element.