Accurate characterization of the mechanical behavior of geomaterials at depth is a fundamental need for geologic and engineering purposes. Laboratory tests on samples from well cores provide the material characterization in terms of mechanical response and other relevant properties. Representativeness of a sample data set with respect to the in situ conditions at depth is a key issue, which needs to be addressed to extrapolate the laboratory response to the whole rock mass. We have developed a procedure aimed at quantitatively evaluating the representativeness of laboratory samples. The methodology is based on joint processing of laboratory ultrasonic tests and wellbore sonic logs. A structural index is used to quantify the difference between the average structure of the laboratory sample and the structure of the formation at the wellbore scale. This index could be used to identify different causes of discrepancies between the behavior of the cored samples and the behavior of the rock formation as documented by well logs. Then, it could also be used to integrate laboratory data for the construction of a reliable geomechanical model with reference to the real in situ state. The methodology was applied to three different experimental data sets, showing the effectiveness of the method.