title: How find one value from other row
body: <p>I have the following table:</p>
  
  <p><img src="https://i.stack.imgur.com/qf1iK.jpg" alt=""></p>
  
  <p>I need add 1 in b column when (when the first 1 is found, then you need to add up all the 1 when this condition satisfied: c like a. Do not put 0 and 2, I only need 1): </p>
  
  <ol>
  <li>find there b=1, and then </li>
  <li>if c like a </li>
  </ol>
  
  <p>This is my desired output</p>
  
  <p><img src="https://i.stack.imgur.com/oJLDJ.jpg" alt=""></p>