In C1 enter =(A1*2)-B1
Then press enter
Then select C1 again and double click on the little box in the bottom right of the cell
As if by magic the formula will populate all the cells below with data in A and B
Then enter =SUM(C1:C100) in to cell D1
Then press enter
Then select D1 again and drag the little box in the bottom right of the cell until you have enough cells populated with the desired result