The inertia of a Hermitian matrix is defined to be a triplet composed by the numbers of the positive, negative and zero eigenvalues of the matrix counted with multiplicities, respectively. In this paper, we give various closed-form formulas for the maximal and minimal values for the rank and inertia of the Hermitian expression $A + X$, where $A$ is a given Hermitian matrix and $X$ is a variable Hermitian matrix satisfying the range and rank restrictions ${\rm range}(X) \subseteq {\rm range}(B)$ and ${\rm rank}(X) \leqslant k$. Some expressions of the Hermitian matrix $X$ such that $A + X$ attains the extremal ranks and inertias are also presented.