View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default add multiple numbers in one cell with those numbers remaining visi

Assuming Harlan's guess is correct (your cells could contain a string like 1
2 4 17 -5 2 0 -7 23 which you want to total up to get 37 as the answer)...
if you are able to use VB code (I say able because you may have to adjust
your security settings in order to be able to use VB code), there is a
simple User Defined Function (UDF) that can be implemented to do this. Press
Alt+F11 to get into the Visual Basic Editor, click Insert/Module on its menu
bar and then copy/paste the following into the code window that opened up...

Function SumCell(R As Range) As Double
SumCell = Evaluate(Replace(R.Value, " ", "+"))
End Function

Now, go back to a worksheet, put a space-delimited set of numbers (say 1 2 4
17 -5 2 0 -7 23) into a cell (say, C5), and put this in the cell you want
the sum to appear in...

=SumCell(C5)

and the formula should evaluate to 37. You can now use this formula like any
other putting the cell you want to sum between the parentheses.

--
Rick (MVP - Excel)


"TD" wrote in message
...
I'm trying to perform a function where I input multiple numbers into one
cell
and have their sum appear in an adjacent cell. I will need to do this
repeatedly through many rows. Can someone please advise?! Many thanks.