To solve the problem of heterogeneous demand in the grid, grid users' preferences are summarized by means of their utility functions. This paper proposes to use measurable characteristics to formulate utility functions, rather than abstract utility function used in other works. The grid user utility is defined as a function of the grid user's the resource units allocated. An optimal solution maximizes the aggregate utilities of all grid users subject to the grid resource capacity and job complete times constraints. At same time, the grid provider adjusts the unit price in order to maximize its revenue, which is measured as the sum of the individual payments. This paper proposes an iterative algorithm that computes the price and resource allocation, which is proved to converge to the optimal point. Simulation results show that our proposed algorithm is more efficient than conventional allocation scheme.