Running Total VBA - Add / Subtract Number In B And C?
Apr 10, 2014
I am creating a spreadsheet for inventory use. I want to have a running total in (1) cell based upon a new/different number being entered into a different cell.
Column B, Row 1 (This will be a new/different number entered every day - inventory in or out, so positive or negative number)
Column D, Row 1 (This will be a running total based on numbers inserted in previous 2 columns)
Basically what I have is a key inventory. So there is column A with key number, B should be keys IN, C should be keys OUT, or ideally B would be IN and OUT meaning, for inventory IN input a positive number and for inventory OUT input a negative number, and D Should be total.
Column E represents number of keys currently in the inventory. I was going to hide the current inventory column so all you see is IN/OUT and total. So what I need is to be able to just come in and type in a number in the IN and/or OUT column, without having to add/subtract it with the number already in that column.
Bottom line, I'd like to be able to use IN and/or OUT columns to just type in numbers as they come and not have to worry about what's already in those columns and get correct total number.
Ok here it is. Attached worksheet shows
Column A - Key Numbers...No data value
Column B - Inventory IN
Column C - Inventory OUT
Column D - Total
Column E - Current Inventory(Starting point)
So the formula I used to get what i currently have is (=B2-C2+E2). This way whatever i input in columns C and C. totals out in D. But this way every time I want to add/subtract a number in B and C, i have to add to the number already in the column. I'd like to be able to type in a number in B and C as i go and still have a correct total. I wouldn't mind having just one column for in/out and use positive and negative numbers to differentiate inventory in or out.
In cell A1 i have a total amount, lets say it's 20, in B1 i have a value of 5, in C1 i have 10.
Looking to see if it's possible to take the 5 from cell B1 to make A1 = 15, then 10 from cell C1 to make it 5 in A1 whilst reducing both columns B and C to zero If B1 or C1 are greater than the value in A1, A1 displays that amount that would be left
only thing i can think of is a hidden column to calculate whilst incorporating an if statement into B & C?
I am trying to create a very basic workbook that has 2 worksheets. one is a daily input for tonnes, that then just gets cut and pasted to a different program, and the other worksheet is the running total. i.e., it adds up every time you update it. been trying to figure out a macro so when you press the update button it then just updates the monthly total.
I am creating a spreadsheet for inventory use. I want to have a running total in (1) cell based upon a new/different number being entered into a different cell.
Column B, Row 1 (This will be a new/different number entered every day - inventory in or out, so positive or negative number)
Column D, Row 1 (This will be a running total based on numbers inserted in previous 2 columns)
Basically what I have is a key inventory. So there is column A with key number, B should be keys IN, C should be keys OUT, or ideally B would be IN and OUT meaning, for inventory IN input a positive number and for inventory OUT input a negative number, and D Should be total.
Column E represents number of keys currently in the inventory. I was going to hide the current inventory column so all you see is IN/OUT and total.
So what I need is to be able to just come in and type in a number in the IN and/or OUT column, without having to add/subtract it with the number already in that column.
Bottom line, I'd like to be able to use IN and/or OUT columns to just type in numbers as they come and not have to worry about what's already in those columns and get correct total number.
Ok here it is. Attached worksheet shows Column A - Key Numbers...No data value Column B - Inventory IN Column C - Inventory OUT Column D - Total Column E - Current Inventory(Starting point)
So the formula I used to get what i currently have is (=B2-C2+E2). This way whatever i input in columns C and C. totals out in D. But this way every time I want to add/subtract a number in B and C, i have to add to the number already in the column. I'd like to be able to type in a number in B and C as i go and still have a correct total. I wouldn't mind having just one column for in/out and use positive and negative numbers to differentiate inventory in or out.
I want CELL A2 to be a blank cell which people can enter a number in that will decrease the value of A1 and once that value is entered, it would return to a blank cell. CELL A3 would be used in the same fashion except to increase the value of A1
Is it possible to add to or subtract from the value of a cell with a macro? For example, lets I have a cell that contains the number of nails in a drawer (200) and I needed to remove one. I enter the number 1 in a cell and hit the remove button. The cell that contains the value of total nails would then be one less (ie: 200-1=199).
If I used a user form for something like this what would the vba look like?
Also, I realize that this would probably be easier with Access however, I do not know Access very well at all and the number of items I have to do this with would not warrant a database.
These are mileage numbers. At the end I need to know the total miles driven as miles are added. I need to be able to see the total miles driven as mileage is added. At the end of the week, I need to see total miles driven.
I have several columns of sub-total and total as shown in the screen print. I need some code that will allow me to take the value of total and subtract it from sub-total. The number of rows changes weekly so I cannot simply state =f10-f11
I thought xlup and offsetting would be a good way to do it, but I'd still need to assign a cell number.
I have 2 tables, one with invoices, the other with purchase orders. I would like to have a "PO Amount Remaining" column on the invoice table that looks up the PO listed on the invoice with the PO $ amount on the PO table. Once it is matched, I would like to subtract the total invoices to give me the amount of the PO that is left. Basically I would like the "PO Amount Remaining" column right now to have $4,200 listed in each row for invoices 1 & 2.....
In an excel work shift schedule, I am trying to total the total number of days someone is scheduled for different shifts. I can get a total for the current schedule but I want to be able to have a year to date total as each new schedule is added in. These totals are in the AF through BC columns in the xray shift totals in the attached worksheet.
I don't know if it is possible or not and am working on a pre-existing worksheet.
'Pivot Table Calculated Fields" - Below is my pivot table.
I need the pivot table to subtract 'February' sales figures from 'January' sales figures to get the difference (variance).
I know the following steps:
1) Click on the Pivot Table
2) Choose "Formulas"
3) Choose "Calculated Field"
4) In the "Name" field - type in the name that I want "Two Month Variance" (for example)
5)......then I don't know what to do
Sum of Quantitymonthsupplier idjanfebGrand Total 754466163150842519337568263901785022875682639410025035075682639500 75682639642523866375682639780012492049756826398209209756826399292292 756826400264264756826401178178757494037292292761034919209209867233456264264(blank) Grand Total245154236931
On the attached worksheet i have blocks of data in col C in chronological order,i wish to count the number of times related data in col AG is between 1 & 3 incl (highlighted in blue) ,the result to be expressed as a % in col V,eg block A =5,col AG has 2 event between 1 & 3,so col V = 40%.I have inserted empty rows between the data for clarity,there are no empty rows in the data.
I've attached a sample workbook. I'm trying to have a running total on column F once column G is completed with a ship date. The formula I have right now is =IF(G2:G55<0,SUM(F2:F22),0). but it's coming up w/zero.
I want to calculate a running total (so add a new value to its original value). For example, cell A1 is the one I will be changing daily, and cell B2 is the one that I want a running total in. So if I start with A1 being 5, B2 should be 5. If the next day I type in 3 into A1, B2 should now read 8. However I want to do this for a column length, not just cells A1 & B1. So column B would be the running total of the column A values. If A2 is 3 one day and the next it is 6, B2 should on the second day read 9. And on and on down the columns.
I tried doing this without VBA using iterations, but that didn't work. Every time I did that it would add values going down, which was weird cuz none of the cells referenced the cell above it. I didn't know if they would work since I have multiple sheets in this file. (I'm only calculating the running total in one sheet, the others aren't doing anything special.) I need all the sheets in my file and I didn't know if VBA modules are sheet specific/ if you need to be sheet specific when coding.
Another question I have (since I know nothing about VBA) is how do modules work? Do you need to turn them on in the Excel spreadsheet itself? Or when you save it does it just automatically apply itself to the file its attached to?
On another note, how to do this WITHOUT VBA, that would be like 100x more fantastic.
I am creating an employee database. Any simple method for recording then calculating a total of occurrences when someone is tardy. I thought of using an OptionButton but I don't know how it could be applied and stored in my database. This is the code for the form as it exists now:
This works for me when my list of values begin in Cell A1.
Put this formula in Cell B1 and copy down: =SUMPRODUCT(SUM(INDIRECT("$A$"&MAX(--($A$1:A1=0)*ROW($A$1:A1),1)&":"&CELL("address",A1))))
"Midnight404" wrote:
> I want to keep a running total of one column but if it > encounters a zero in the column then I want the zero to reset the total to > zero and continue from that point.
The following code works great in selecting individual cells and forming a text string with them. What I need to do is to change this slightly andi instead of just reading the cell, have the preceding value added to the current value "(Cells (e,i)" and that new runnng total value is added to the "temp" string.
The concept is 12 cells represent Jan - Dec (numbered 1-12) I'm trying to perform a running total; where Feb(2) = (Jan(1) + Feb(2)) and Mar(3) = Feb(2) + Mar(3).....
I tried setting x to do the running total and then passing it to "temp" but I kept getting mismatch errors, or buffer overflow errors, or out of memory errors.
Is there someone who can provide some assistance with the proper way to do this? ....
After about 3 hours of online research, and maybe an hour or so of experimenting with the IF command, my mind is blown and I, essentially, have given up!
I have a spreasheet with each column representing a month, then four more colums to represent quarterly values, and one other for a summary of the entire year.
I don't want a cumulative running total. For example, if I enter a value for January, that value should appear in the 1st quarter column, and yearly summary colum.
Now, if I enter in a February value, the 1st quarter column should display the February value. I need the 1st quarter column to "update" for each of the three months within the quarter. Likewise for the yearly column except, obviously, I need it to update for each of the 12 months.
I started toying with the IF function, with limited success, but there MUST be an easier way?
i am setting up a material iventory using excel 2007 i require a worksheet to contain a column for stock in (+) and stock out (-) and a running total column, but i am struggling to create a formula for this. my column's would be (J) for stock In (k) for stock out and (L) as Running total
I know what to do when I add them- if the number is positive then a payment is due, if its 0 then the employer is "Up to Date" But what if they pay me more than they owe? I owe them hours, how can I have excel know that there is a surplus and to deduct the future hours worked from the surplus until i've paid it off?
I have my problem in an excel spreadsheet but I don't know how to upload so you can download it for reference.
I know this may have been answered before but I didn't really understand those answers and my scenario is slightly different. I have a UserForm that I am asking people to enter data into. One part of the UserForm asks for a percentage spread across an age range. For example for the age ranges 16-20, 21-25, 26-30 (etc) whats the percentage of smokers. This will obviously then add up to 100% which I want to put in a ' total' box at the end of the line of input boxes. I want this box to be updated whenever someone enters a percentage into the boxs but I can't seem to work out how to do it. That's basically what I'm asking help for on. Its easy enough when doing it on the spreadsheets themselves with the SUM function but how can I do it on a UserForm. Does it need some complex VB coding?
Basically, I'm trying to have a cell (eg.A1) where i can input a dollar value and when enter is pressed, on another cell (eg.A2) the dollar value gets added, then the original cell (A1) is cleared for the next input.
Then when I put the next input (A1) I want it to add on to this running dollar total (A2) and yet again A1 is cleared for the next input.
In addition to this I require an additional cell (eg.A3) that when each time a value is added in A1 it counts the times this is done.
I am trying to model emergence timing of eggs based on cumulative temperature units. When the eggs (Column L) deposited on a given date have accumulated 1600 tu's (a running total of Column N) I wish to return the original number (Column L) to a column (Column Q) in Excel. I have also tried returning the date at which cumulative tu's reach 1600 with dget. Unfortunately, I can't figure out how to use Dget or some other function to deal with the relative sums for each value and step through to the next value when the first is returned.
I can get the first number by entering the following formula into Column Q, =IF(SUM(N$9:N18)>1600,M$9,0) but I don't know how to increment it once the first value is returned.
I am working on a spreadsheet to track hours worked. It is an 8 hr day. I want there to be a running total, but when less than 8 hrs are worked and the total goes below 8 hrs per day (as in when you have no "banked time" it will not display negative or owned time. Also, it doesn't seem to want to skip over the weekends for me.
I'm trying to create a spreadsheet that uses one cell to enter a dollar amount and stores the amount entered in another cell. But I would like the input cell be zero after each entry, and the cell storing the amounts to keep a running total.
I am creating a spreadsheet for inventory use. I want to have a running total in (1) cell based upon a new/different number being entered into a different cell.
Column F, Row 7 (This will be a new/different number entered every day) Column G, Row 7 (Begins with a starting total of 2545)
I need Column G to add to it whatever number is entered into Column F, Row 7 and to keep the new total (ex. enter 10 into Column F/Row 7 & the total of Column G/Row 7 becomes 2555; if I then enter 20 into Column F/Row 7, Column G/Row 7 adds 20 to the original 2545, not the new total of 2555).
Column G is not keeping the new total, it reverts back to the original number of 2545.
My question is I have an exam and I have recorded all my answers in Column B. And I have pasted in the "Official Answers" on Column C. On my sheet Column C is whited out so I don't see the answers until I am done. I made them visible so I can ask my question. I wrote the formula for Column D "=countif(B3,C3)=1" then it displays True if both the columns match meaning my answer is correct or False if the columns don't match meaning that my answer is incorrect.
how I could make it display the running total or like a total score say in cell D9. So for example in this case it would be 5/6 and /or 83.33%.