View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default How do I add/count numbers in the same cell in excel worksheet

Brecken

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 Wed, 10 Jan 2007 22:21:01 -0800, Brecken
wrote:

Isn't there another way that's easier, though, so I can just add a number and
have it automatically added to the existing number in the same cell? Thanks.

"Scott" wrote:

Probably the wisest way to use one cell to do this would be to put the
following in the cell:

=127

When you get a $50 receipt, change it to:

=127+50

When you get another receipt, say 34.95:

=127+50+34.95

The reason to do it this way is so that if you happen to make a mistake
when entering the value, you don't lose your previous data.

Scott

Brecken wrote:
How do I create a function or formula in acell to perform this operation?
(i.e if I have the number 127 in a cell and want to to enter 50 into the same
cell so that I get a sum of 177 in the same cell, how do I do this, rather
than adding the 2 numbers in my head, and manually entering 177?) I am doing
this for purposes of a budget and entering receipts. If the amount I've
spent on groceries is $127 up to the present time, and I want to add an
additional grocery receipt of $50, I want to be able to have the cell add the
new entry, rather than adding the 50 in my head and enter $177. Thanks!