Forum Discussion

Excel's avatar
Excel
Iron Contributor
Mar 12, 2022
Solved

Dynamic Substract

Hello Everyone,

 I would like the number in cell C2 to decrease every time I add a number to the whole of the column C. I would like for any number I enter into the B column to be subtracted automatically from the C2 cell every time a new number is written.

 

What formula should i write?

 

Please help..??

 

Here is a attached file...

 

  • Excel 

     

    Use this formula =$C$2-SUM($B$3:B3). Also, I have attached screenshot for reference.

     

9 Replies

  • Excel 

    With an up to date version of 365, one could have

    = IF(paidBack, 
         SCAN(loanAmount, paidBack, 
              LAMBDA(acc,p, acc-p)),
      "")

    which grows dynamically

  • Gaurav675's avatar
    Gaurav675
    Copper Contributor

    Excel 

     

    Use this formula =$C$2-SUM($B$3:B3). Also, I have attached screenshot for reference.

     

    • Excel's avatar
      Excel
      Iron Contributor
      it worked! Thank you so much sir.
  • Excel's avatar
    Excel
    Iron Contributor
    Sir! is it possible to automatic change in C2 when we enter number in B2?
    • Excel 

      I think you want to do this row by row. I would not recommend that: you would not have a history of changes, and it would be very difficult to correct mistakes.

      But if you really want it, you could use the Worksheet_Change event procedure. See the attached version (now a .xlsm workbook)

      • Excel's avatar
        Excel
        Iron Contributor
        It helps.
        Thank you so much sir.

Resources