A new exact solution to the problem of Marangoni layered convection is obtained. This solution describes a layered steady-state flow of a viscous incompressible fluid at varying gradients of temperature and pressure. The velocity components depend only on the transverse coordinate; the temperature and pressure fields are three-dimensional. The Marangoni effect is observed on the upper free surface of the fluid layer. On the lower solid surface of the fluid layer, three different cases of defining boundary conditions are considered: the no-slip condition, the perfect slip condition and the Navier slip condition. The obtained exact solution is determined by the interaction of three flows: a flow caused by pressure drop (the Poiseuille flow), a flow caused by heating/cooling and the effect of the gravity force (the thermogravitational flow), and a flow caused by heating/cooling and the fluid surface tension effect (the thermocapillary flow). The obtained exact solutions in the case of each of the three types of boundary conditions specified on the lower surface are analyzed in detail. It has been proved that, when certain ratios of the boundary value problem parameters are fulfilled, the velocity components may acquire stagnation points, this being indicative of the presence of counterflow areas in the fluid layer under consideration. In particular, the presence of up to two stagnation points in each of the two longitudinal velocity components may cause a stratification of the velocity field in more than two regions. The obtained exact solution of the Marangoni layered convection problem can describe flows in thin films through the variation of the geometric anisotropy factor.