1. For each item, everyone "bids" on that item how much they're willing to pay. I recommend setting a minimum bid somewhere around 50-80% of the item's market value; if items sell too low, then it shafts people who don't bid on items. On the other hand, there's no reason to bid more than the market value, because then you could just commission the item yourself.
2. Each item goes to the person who bid the most.
3. Each item which was not bid on gets sold/disenchanted/etc.
4. Add together the value of all treasure, including the winning bid on items which were bid on to calculate the total treasure value. For items which were (or will be) sold or disenchanted, add them at the value you get (i.e. 20% of market value).
5. Divide the total treasure value into the number of players evenly. This includes the value of the items people get.
Example:
Alice, Bob, Charlie and Dan find a Rod, a Sword, a Staff, and 10,000 GP worth of art, gems and coins.
Alice wins the Rod, bidding 5,000 gp
Charlie wins the Sword, bidding 8,000 gp.
Nobody wants the Staff. It will be disenchanted into 1000 gp worth of residuum.
Total treasure value is 10,000 (art, gems and coins) + 1000 (staff) + 8,000 (Sword) + 5,000 (Rod) = 24,000 gp
Thus, each player gets 6,000 gp worth of treasure. Also, note that there's only 11,000 in liquid assets (i.e. art, gems, coins, and residuum).
Alice's share is 1000 gp plus the Rod (which she bid 5,000 GP for).
Bob's and Dan's shares are 6,000 gp each, since neither won any items.
Charlie's share is the sword, which he bid 8,000 GP on.
Here's where things get a bit complicated. Note that between Alice, Bob, and Dan, a total of 13,000 GP is owed, but there's only 11,000 GP. A problem!
However, Charlie's share was worth 8,000 gp, but he's only supposed to get 6,000. Thus Charlie must pay the group 2,000 gp from his own purse to get the sword. That 2,000 gp goes to paying off Alice's, Bob's and Dan's shares.
It seems more complicated than it is, really. Basically, just establish a value for everything and then split it up evenly.