Matrix rank and inertia optimization problems are a class of dis- continuous optimization problems in which the decision variables are matrices running over certain matrix sets, while the ranks and inertias of the vari- able matrices are taken as integer-valued objective functions. In this paper, we establish a group of explicit formulas for calculating the maximal and minimal values of the rank and inertia objective functions of the Hermitian matrix-valued function A1 B1XB 1 subject to the common Hermitian solu- tion of a pair of consistent matrix equations B2XB 2 = A2 and B3XB 3 = A3, and Hermitian solution of the consistent matrix equation B4X = A4, respec- tively. Many consequences are obtained, in particular, necessary and su- cient conditions are established for the triple matrix equations B1XB 1 = A1, B2XB 2 = A2 and B3XB 3 = A3 to have a common Hermitian solution, as well as necessary and sucient conditions for the two matrix equations B1XB 1 = A1 and B4X = A4 to have a common Hermitian solution.