If the outermost shell of an atom contains 4 or less electrons, the valency of an element is equal to the number of electrons present in the outermost shell; if it contains more than 4, the valency of an element is calculated by subtracting the total number of electrons from 8.