Utility function is an economic term that describes whether someone's wants are satisfied. While it is theoretically just a matter of addition, the reality is that defining satisfaction in objective terms is extremely difficult. Indeed, it may be impossible.
However, if you want to focus on one part of someone's satisfaction, you can use utility function to calculate how well their current lifestyle is meeting that definition of satisfaction.
The equation is U=f(x1, x2,...xn)
Define what part of someone's life utility is going to be defined for this exercise. So, for example, assume that your satisfaction is directly related to how many office supplies you have.
Find your X values. If someone owns one stapler, four reams of paper, one laptop and a photocopier, then his utility formula will be U=f(1,4,1,1)
Add your X values together. In this case, the utility value is 7 for our subject.
Remember that utility value is an attempt to express subjective values objectively; they are often not the best indicator of actual happiness.