 This effect is great enough that the energy ranges associated with shells can overlap.The filling of the shells and subshells with electrons proceeds from subshells of lower energy to subshells of higher energy.This follows the "n + ℓ rule" which is also commonly known as the Madelung rule.