When there are only two people in an economy, the markets clear when the sum of their excess demands is equal to zero. The same rule holds no matter when how many people there are in the economy: the market clears when the sum of the excess demands is equal to zero. Try this three-person example:
Consider an economy consisting of three people - Athos, Portos, and Aramis. Each of the three is endowed with a certain quantity of bread and a certain quantity of roasted chickens. There is a market in which bread can be traded for roasted chickens; and the prevailing price in that market, p, is the price of a roasted chicken measured in loaves of bread. The excess demands for roasted chicken of Athos, Portos, and Aramis are, respectively,
a) Find the equilibrium price of roasted chickens. At the equilibrium price, who is buying chickens and who is selling them? How many chickens is each person buying or selling?
b) At the equilibrium price, who is buying bread and who is selling it? How much bread is each person buying or selling?