Matrix rank and inertia optimization problems are a class of discontinuous optimization problems in which the decision variables are matrices running over certain matrix sets, while the ranks and inertias of the variable 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 expression A1 − B1XB * 1 subject to the common Hermitian solution of a pair of consistent matrix equations B2XB * 2 = A2 and B3XB * 3 = A3, and Hermitian solution of the consistent matrix equation B4X = A4, respectively. Many consequences are obtained, in particular, necessary and sufficient 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 necessary and sufficient conditions for the two matrix equations B1XB * 1 = A1 and B4X = A4 to have a common Hermitian solution. are given, i = 1, 2, 3, and X ∈ C n H is a variable matrix, and study the following constrained optimization problems: Problem 1.1 For the constrained linear matrix-valued function in (1.2), establish explicit formulas for calculating max X∈C n H r(