ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   FORMULA (https://www.excelbanter.com/excel-worksheet-functions/211108-formula.html)

mdriscoll

FORMULA
 
I am not sure if Excel is capable of doing this, but hopefully someone out
there knows. I am trying to create a formula to do the following: In one
cell I will have a running total and in the other cell I want to enter a
number that will carry over to the cell with the running total in turn making
that cell blank until another number is entered.

Example: Cell One, enter the number three, Cell Two, current number 150
will change to 153 and Cell One will go back to a blank cell util used again.

????? This would be a great time saver if this is possible.




JE McGimpsey

FORMULA
 
See

http://mcgimpsey.com/excel/accumulator.html


Modify it by inserting the line

.ClearContents

after

Range("B1").Value = Range("B1").Value + .Value


Note that this is, often, very inefficient, since there's no history -
if you make a mistake, it's difficult to recover.


In article ,
mdriscoll wrote:

I am not sure if Excel is capable of doing this, but hopefully someone out
there knows. I am trying to create a formula to do the following: In one
cell I will have a running total and in the other cell I want to enter a
number that will carry over to the cell with the running total in turn making
that cell blank until another number is entered.

Example: Cell One, enter the number three, Cell Two, current number 150
will change to 153 and Cell One will go back to a blank cell util used again.

????? This would be a great time saver if this is possible.


Shane Devenshire[_2_]

FORMULA
 
Hi,

These is no formula to do this, you will need to use VBA. Basically you
want on Worksheet_Change event.

Hi,

Here is an example of event code using the Intersect function:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Isect As Range
Set Isect = Application.Intersect(Target, [A1])
If Not Isect Is Nothing Then
[B1] = [B1] + [A1]
[A1].Clear
End If
End Sub

Here a number is being entered into A1 and then it is added to the entry in
B1 and then A1 is cleared.

1. To add this code to your file, press Alt+F11,
2. In the VBAProject window, top left side, find your sheet name under your
file name and double click it.
3. Paste in or type the code above.

If this helps, please click the Yes button

Cheers,
Shane Devenshire

"mdriscoll" wrote:

I am not sure if Excel is capable of doing this, but hopefully someone out
there knows. I am trying to create a formula to do the following: In one
cell I will have a running total and in the other cell I want to enter a
number that will carry over to the cell with the running total in turn making
that cell blank until another number is entered.

Example: Cell One, enter the number three, Cell Two, current number 150
will change to 153 and Cell One will go back to a blank cell util used again.

????? This would be a great time saver if this is possible.





All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com