The energy efficiency of the building should be understood as the degree of preparation of the building to ensure the comfort of its use in accordance with its intended use with the lowest possible energy consumption of the building. The article presents an in-depth analysis of the possibility of changing the utility function of a historic building in such a way that ensures all aspects of comfort while meeting energy efficiency conditions. Combinatorics methods were used for this purpose. Four possible utility functions were proposed, including the reference state, i.e., the existing state. Five aspects of comfort were considered: thermal comfort, carbon footprint, energy efficiency, noise and vibration. For these five aspects of comfort, boundary conditions were adopted depending on the adopted building class. The selected utility function is therefore the result of comfort, energy efficiency and economic aspects. The purpose of the study was to verify whether the developed methodology for the selection of the utility function for historic buildings, based on combinatorial analyses, would allow the selection of the optimal function from the point of view of energy efficiency, user comfort and environmental impact. The methodology was tested on a historic building located in southern Poland. The new utility function for the analyzed building is to use the historic villa (or some part of it) as an Art Gallery.