Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rod Rod is offline
external usenet poster
 
Posts: 108
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop Macro a variable number of times thesaxonuk Excel Discussion (Misc queries) 11 October 31st 06 06:05 PM
place a number in a cell ADiscrete1 Excel Worksheet Functions 3 June 13th 06 01:27 AM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
read a column of names and place a number in the next cell Judy Hallinan Excel Discussion (Misc queries) 1 December 7th 05 11:48 PM
cell that accepts a whole number or five place deciaml crck_whr Excel Worksheet Functions 2 November 12th 04 04:14 PM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"