Cost Basis Formula