Summing until criteria are met in another column

Closed
Bill_Denver Posts 1 Registration date Thursday June 2, 2016 Status Member Last seen June 2, 2016 - Jun 2, 2016 at 05:07 PM
I have a situation where I want to sum a column of numbers from bottom to top but want the summation to stop when criteria from another column is met. Example: in one column I have values (ascending): 10, 20, 30, 40, 50, 30, 40. Then in an adjacent column I have values of either 1 or zero. Most of the values are 1. In summing the column, as soon as the adjacent value is zero I want the summation to stop. So, if the value adjacent to 40 above was zero then the sum would be 10+20+30+40 =100. Anyone have an idea how to do this in Excel? Thanks in advance.