In this paper, we give a necessary and sufficient condition for a function with the form to be a generalized bent function. We indicate that these generalized bent functions are just those which could be constructed from partial spreads. We also introduce a method to calculate these generalized bent functions by means of interpolation.