title: spreadsheet/VBA to calculate multi-level marketing income
body: <p>I am trying to help a friend who wants to set uo a MLM organisation. He needs to calculate income for everyone he will enroll.</p>
  
  <p>The issue is that a top-level employee gets his own commission PLUS a percentage of everyone's commission he has enrolled...</p>
  
  <p>[Do]
  ...these guys in turn get their own commission PLUS also a percentage of everyone's commission that they have enrolled, and this additional commission also has an upstream effect on the top level guy's percentage (this goes all the way down the line)...
  [Loop]</p>
  
  <p>potentially, this goes on ad-infinitum. So I can't calculate the upstream commission until I have calculated the commission right down to the bottom, but there may be hundreds of levels.</p>
  
  <p>In the data I'm looking at, I know everybody's sales and I know the ID no. of the person who has enrolled them, I don't necessarily know how far down a chain they are.</p>
  
  <p>How can I model this for him? I can't get my head round it.</p>
  
  <p>Has anyone else ever had to work this out? Am I missing something obvious?</p>
  
  <p>Thanks</p>