In microeconomics, an excess demand function is a function expressing excess demand for a product—the excess of quantity demanded over quantity supplied—in terms of the product's price and possibly other determinants. It is the product's demand function minus its supply function. In a pure exchange economy, the excess demand is the sum of all agents' demands minus the sum of all agents' initial endowments.
A product's excess supply function is the negative of the excess demand function—it is the product's supply function minus its demand function. In most cases the first derivative of excess demand with respect to price is negative, meaning that a higher price leads to lower excess demand.
The price of the product is said to be the equilibrium price if it is such that the value of the excess demand function is zero: that is, when the market is in equilibrium, meaning that the quantity supplied equals the quantity demanded. In this situation it is said that the market clears. If the price is higher than the equilbrium price, excess demand will normally be negative, meaning that there is a surplus (positive excess supply) of the product, and not all of it being offered to the marketplace is being sold. If the price is lower than the equilbrium price, excess demand will normally be positive, meaning that there is a shortage.
Walras' law implies that, for every price vector, the price–weighted total excess demand is 0, whether or not the economy is in general equilibrium. This implies that if there is excess demand for one commodity, there must be excess supply for another commodity.
While some theories postulate that market prices go instantaneously to their equilbrium level, meaning that we always observe situations of zero excess demand, others postulate that the process of adjusting to equilibrium, after some change has occurred to non-price determinants of demand or supply, takes some time due to stickiness of prices. Often it is assumed that the rate of change of the price is proportional to the value of the excess demand function. If continuous time is assumed, the adjustment process is expressed as a differential equation such as