Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Add a Number to a Cell and place the number in the same cell
If I have a Number in Cell A1 and then want to add say 10 to that number, I
then want to replace the Number in A1 with the new results. If A1 has 10 Then A2 has 20 I want A1 to then say 30. If I change A2 to then 10 again Then A1 changes to 40. I need like a running SUM in a Cell. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Add a Number to a Cell and place the number in the same cell
very easy
1. put the value in A2 2. copy A2 3. Select A1 and paste/special with the add checked A1 will now have its old value plus the value you entered in A2 -- Gary's Student "Rod" wrote: If I have a Number in Cell A1 and then want to add say 10 to that number, I then want to replace the Number in A1 with the new results. If A1 has 10 Then A2 has 20 I want A1 to then say 30. If I change A2 to then 10 again Then A1 changes to 40. I need like a running SUM in a Cell. |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Add a Number to a Cell and place the number in the same cell
You could use some code to do this. Here is one way.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Range("A2").Value = Range("AA1").Value Then End Range("A1").Value = Range("A1").Value + Range("A2").Value Range("AA1").Value = Range("A2").Value End Sub This uses cell AA1 to store the number in A2. If A2 changes, then the new number is added to A1, otherwise it is left alone. HTH, Paul "Rod" wrote in message ... If I have a Number in Cell A1 and then want to add say 10 to that number, I then want to replace the Number in A1 with the new results. If A1 has 10 Then A2 has 20 I want A1 to then say 30. If I change A2 to then 10 again Then A1 changes to 40. I need like a running SUM in a Cell. |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Add a Number to a Cell and place the number in the same cell
Rod
Are you sure you want to do this? Think about it after reading the following. You can have a cumulative total in a cell if you have a separate source cell for adding a new total to the original. Use at your own risk. I am Posting this just to show you how it can be done, not as a good solution. You would be much better off to have another column so you can keep track of past entries. Goes like this: =IF(CELL("address")="$C$4",C4+D4,D4) Enter this in cell D4 and then in ToolsOptionsCalculation check Iterations and set to 1. Now when you change the number in C4, D4 will accumulate. Note 1. If C4 is selected and a calculation takes place anywhere in the Application D4 will update even if no new number is entered in C4. NOT GOOD. Note 2. This operation is not recommended because you will have no "paper trail" to follow. Any mistake in entering a new number in C4 cannot be corrected. NOT GOOD. To clear out the accumulated total in D4 and start over, select D4 and EditEnter. Check out Laurent Longre's MoreFunc.xla. Has a Function RECALL which does what you want without the re-calculation problem, but again there is no "paper trail" for back-checking in case of errors in data input. http://longre.free.fr/english/func_cats.htm Also see John McGimpsey's site for VBA method and the same caveats as above. http://www.mcgimpsey.com/excel/accumulator.html Gord Dibben Excel MVP On Fri, 22 Dec 2006 10:32:00 -0800, Rod wrote: If I have a Number in Cell A1 and then want to add say 10 to that number, I then want to replace the Number in A1 with the new results. If A1 has 10 Then A2 has 20 I want A1 to then say 30. If I change A2 to then 10 again Then A1 changes to 40. I need like a running SUM in a Cell. Gord Dibben MS Excel MVP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Loop Macro a variable number of times | Excel Discussion (Misc queries) | |||
place a number in a cell | Excel Worksheet Functions | |||
Custom functions calculating time arguments Help Desperate | Excel Worksheet Functions | |||
read a column of names and place a number in the next cell | Excel Discussion (Misc queries) | |||
cell that accepts a whole number or five place deciaml | Excel Worksheet Functions |