Non-monetary Exchanges

Can someone help me out, with a non monetary exchange lacking commercial substance, what is the formula to calculate gain: Is it Cash / (Cash + FV of Asset Received) or Cash / (FV of Asset received) Thanks!