Posting a full example calculation will probably provide enough details for us to describe your situation rigorously and work out the conversion formula. Otherwise it's too vague to really say. As Passel suggests, the answer is probably simple to express with a matrix.