Formula ? SUM of 2 cells

cripopes

New Member
Joined
Apr 4, 2021
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello folks,

First of all please excuse my lack of excel knowledge, the following question might seem a bit nooby for you but I'm at my first steps here.

What I'm trying to do is SUM of cell 1 into cell 2 - cell 1 will be constantly changing every day and that input amount to be added into cell 2.

Capture.PNG


For example, I want cell B3 to be added to D3, which will be 278. So basically the input number of B3 to be added into D3. The original value of D3 will not be blank, it will be an input number.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Welcome to MrExcel Message Board.
Try this at Destination Cell:
Excel Formula:
=B3+D3
 
Upvote 0
Welcome to MrExcel Message Board.
Try this at Destination Cell:
Excel Formula:
=B3+D3
Well, cell D3 will be the destination that is not blank, contains an initial value <229>. Every day I will keep changing the value of cell B3 which I want to be added into D3 (which will change only when I modify the value of B3). For example, in this case, the value 49 to be added to 229 which will be 278, the next day I will change that 49 into something else but the value in D3 to remember the previous day change 278 and repeat the operation and so on, on a daily basis.

Sounds very tricky for me but maybe you got a solution.

Thank you.
 
Upvote 0
If you want Added value of B3 whenever it modified to Cell D3 values, You should use VBA, And You cann't do it with formula in Excel:

Right click on sheet name and then Select View Code and Paste this code:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim newVal As Long, oldVal As Long
    If Target.Column = 2 And Target.Row = 3 Then
        'new val
        newVal = Range("B3").Value
        Application.EnableEvents = False
        Application.Undo
         oldVal = Range("D3").Value
        Range("D3").Value = oldVal + newVal
        Range("B3").Value = newVal
        Application.EnableEvents = True
    End If
End Sub
Finally save your files as Macro-Enabled Workbook (.xlsm)
 
Upvote 0
Solution
Thank you, working as intended. However a minor tweak to that code, please. How can I make it to widen the range for the whole B column starting with B3?
 
Upvote 0
Try this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim newVal As Long, oldVal As Long
    If Target.Column = 2  Then
        'new val
        newVal = Target.Value
        Application.EnableEvents = False
        Application.Undo
         oldVal = Range("D" & Target.row).Value
        Range("D" & Target.row).Value = oldVal + newVal
        Target.Value = newVal
        Application.EnableEvents = True
    End If
End Sub
 
Upvote 0
Try this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim newVal As Long, oldVal As Long
    If Target.Column = 2  Then
        'new val
        newVal = Target.Value
        Application.EnableEvents = False
        Application.Undo
         oldVal = Range("D" & Target.row).Value
        Range("D" & Target.row).Value = oldVal + newVal
        Target.Value = newVal
        Application.EnableEvents = True
    End If
End Sub
Thank you, working perfectly. One more thing before eternal thanks. Forgot to mention column C which will hold a purpose too, to work the same as column B but the number which I input to be - from column D.
 
Upvote 0
Please tell with detail & example:
e.g. Cell C3 = Cell C3 + D3 after input new Data
 
Upvote 0
Please tell with detail & example:
e.g. Cell C3 = Cell C3 + D3 after input new Data

From cell C3 to be - from cell D3 but to work for the whole column. To work exactly like previous code you paste but this time with - instead of +.
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,738
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top