Sampling within a given interval with a constraint has not been previously considered. Standard parametric simulation engines require knowledge of the parameters of the distribution from which a sample is drawn. These methods are limited if additional constrains are required for the simulated data. We propose a method that generates the targeted number of individual observations within a given interval with a constraint that the average value of observations is known. This method is further extended to a grouped data setting, as a way of data de-grouping, when the frequency and average value of observations are provided for each group. Several simulation studies are employed to evaluate the performance of the proposed method, in case of both a single interval and grouped data, for different simulation settings. Furthermore, the proposed method is evaluated in the parameter recovery when different distributions are fitted to the de-grouped data. This method is found to be superior to the uniform method previously used in data de-grouping. The results of the simulation study are promising and they show that this method can be used successfully in the applications where data de-grouping requires that the average value of observations is maintained in each group. The application of the proposed method is illustrated on a real data of insurance losses for bodily injury claims.