How To Create A Cumulative Column Based Upon Another Column

Jul 24, 2009

I have a model built that calculates the daily Profit and loss ('Data for Pivot' tab, column M). I would like to calculate the cumulative profit and loss and am having a difficult time doing this with a simple formula. The Daily P/L column is empty (#NA value is in the cells) up until cell C138 as there is no data before that (which is the way it is supposed to be). However, once data has begun to be populated the daily profit and loss is shown (in this case from M138 onwards). The issue I am having is that I cannot seem to be able to create a formula that will capture the cumulative P/L. My desired result is evident in cells N179 onwards, as it simply captures the cumulative p/l. However, this only works if I change the formula once data is populated (in this case cell N177 is where i put in a new formula; the previous formula can be seen in cells N3-N176). If I attempt to put in the formula that is in cell N177 for all of the cells in column N, it gives me an error. Thus, I think that this may need to be programmed via VBA, but I have not been successful in doing this. The issue is that the data population in this model begins on different cells based on the different inputs that I put in ('Mov_Avg_Chart' tab, cells c6 and c8). Thus, I can't hard-code a formula based on a particular cell. If anyone can help me with this,

View 8 Replies


Create Formula In Column B To Add 4 Days To Date Based Upon Column A

Apr 3, 2014

I have a form in which users will manually enter a date in Column A. I would like to create a formula in Column B which will add 4 days to the date based upon Column A. However, the 4 days should only be added to a select set of dates which I would like to specify. If the date is not found in this select set of dates, then the result in Column B should be the same date as Column A.

View 3 Replies View Related

Create Dynamic Top-x List Based On Cumulative Values

Jan 18, 2008

My objective is to automate the creation of a dynamic top-5 list by summing a number related to multiple entries of an item (text string). Data are added monthly and while the textual strings (imported) are constant (text1 always reads as text1) the text strings themselves may vary from "text1" to "text2", etc. What I'm trying to achieve is finding the top-5 five items and copy/paste them to a range on the same worksheet. The range into which they are pasted are source cells for DSUM criteria. The frequency with which a text string appears is not critical, but the associated count is.

View 2 Replies View Related

Conditional And Cumulative Subtraction That Starts Over Again When The Value In A Column Changes

Feb 5, 2010

I am attempting to perform a cumulative subtraction function that starts over again when the value in a column changes. I have a list that is sorted by a column for item number. The other two columns show the amount we have in stock and the amount being ordered against that stock. The order of rows IS relevant and cannot be changed.

Sample output is attached, with the "given" data outlined in a bold border. The only way I have figured out to do this is to nest a whole lot of IF statements in a formula, which is not very elegant or easy to do, and is limited by the number of IF statements that can be nested.

View 2 Replies View Related

Contagious Cumulative Sum Of Dynamic Ranges In Single Column

Nov 1, 2013

I am trying to get the contagious cumulative sum of various data ranges in the same column in my workbook. Data ranges are dynamic so i can not use formulas. I have prepared a table below for illustration. I need the VBA code to calculate the cumulative amounts in column C highlighted in Bold.

There is always a blank row after the cumulative amount. There is also always a text (as in column A of this example) in the same row as where the cumulative is summed up, maybe it can be useful for the code.

I would have written some code but for the algorithm to be used in this case. Maybe a nested for loop, not sure.


Blank Cell
Blank Cell
Blank Cell


View 9 Replies View Related

Change Formula In Column When Cumulative Total Reaches Certain Value?

Jun 22, 2014

i am trying to create a spreadsheet that will automatically plan a days work in manufacturing based on the items the factory is making, the different items obviously have different hourly production targets and id lke to create a spread sheet that knows how many we want to create what the targets are and how long it will take. i also want it to be able to know when it has reached the needed total and automatically plot the targets for the next product, so what i need is a way to change part of the formula when the column reaches a set culmative total

View 3 Replies View Related

Convert Horizontal Data Into Cumulative (one-column) Vertical List

Feb 15, 2012

I have data (400 rows) that looks like this: (23 columns in total): (for this example I am using only 4 rows and 7 columns = 28 rows)

IN_0168 IN_0164 MH_0007 IN_0172 WCD3_03 WCD3_04 #N/A
IN_0176 IN_0172 WCD3_03 WCD3_04 #N/A #N/A #N/A
IN_0185 MH_0006 IN_0164 MH_0007 IN_0172 WCD3_03 WCD3_04
IN_0191 IN_0193 IN_0195 IN_0199 WAT10 #N/A #N/A

and I want it to look like this:



This is what I was trying to do:

For m = 2 To 5
For n = 1 To 23
For b = 2 To 100
Cells(m, n).Select
Cells(b, 1).Select


View 2 Replies View Related

Create Duplicate Rows Based On Value In A Column?

Feb 6, 2010

I have a worksheet with two columns and a few hundred lines. One has titles and the other integers indicating how many times the title needs to be copied to another worksheet or text file.

Existing Worksheet (Input)

Desired Output (Worksheet or Text File) [The entire row, including the integer could be copied as well, if it is easier.]

View 7 Replies View Related

Create Duplicate Rows Based On Value In A Column

Feb 6, 2010

I need a VBA/macro very similar to several I have seen posted here. I have a worksheet with two columns and a few hundred lines. One has titles and the other integers indicating how many times the title needs to be copied to another worksheet or text file.

Existing Worksheet (Input)

Desired Output (Worksheet or Text File) [The entire row, including the integer could be copied as well, if it is easier.]

View 2 Replies View Related

Create New Workbook Based On Column Data

Jan 23, 2008

I was going through a thread that is open now about a similar subject: Create Workbooks & Worksheets For Each Group In Table. I tried getting it to work myself but was unsuccessful. I want a code that will create a new workbook for every new Vendor. I tried doing it myself but was getting compile errors... If this is not what I should be using let me know, it works the way I want with just worksheets, i thought it would be an easy conversion to workbooks

Sub PagesByDescription()
Dim rRange As Range, rCell As Range
Dim wSheet As Worksheet
Dim wSheetStart As Worksheet
Dim strText As String
Set wSheetStart = ActiveSheet
wSheetStart.AutoFilterMode = False
'Set a range variable to the correct item column
Set rRange = Range("A1", Range("A65536").End(xlUp))
'Delete any sheet called "UniqueList"
'Turn off run time errors & delete alert
On Error Resume Next
Application.DisplayAlerts = False
'Add a sheet called "UniqueList"
Worksheets.Add().Name = "UniqueList".....................

View 3 Replies View Related

Macro To Create New Workbooks Based On Values In A Column

Jun 27, 2014

I have data in Column C that looks like this:


Is there a macro that can create workbooks based on this data. So, i'd have one workbook that would contain all the Johns and all the other data in Columns A -Z, then another workbook for Ted, and so on...

The number of workbooks I need is not fixed. It all depends on how many names are in column C.

View 14 Replies View Related

Create Workbooks Based On Unique Values From A Column?

Oct 9, 2012

I have a workbook with about 10000 rows of data for about 100 suppliers in Sheet1 and about 15000 rows of same Suppliers payment details in sheet2.

What I am doing now is:-Filter every supplier names in Column A of sheet1, copy all the rows and paste in sheet1 of a new workook & Again copy the Payment details of a same supplier from master file sheet2 and paste the same in sheet2 of this new workbook then save the files with the supplier name as file name in my documents folder code, that filters each suppliers data from sheet1 & 2 and paste in new workbook sheet1 & 2.

View 1 Replies View Related

Create Step Colors Based On Column Of Numbers

Dec 6, 2006

I have to make a macheine cycle chart. I have a column containing Step Names and a column containing step time in whole seconds. I need to paste the step names across Row 1 and whole numbers counting to X down colum A. I then need to have each second represented by coloring the cell, for example, Step 1 is 1 sec. and Step 2 is 2 sec. if "Step 1" is in B1 I need B2 colored then for "Step 2" in C1 i need C3-4 highlighted and so on for a variable number of steps. This is my first question so I hope I was clear enough. With this much programed I will be able to make simple changes to tweak it to fit my needs.

View 2 Replies View Related

Create Column Of Data Based On Unique Items

Dec 19, 2006

I am trying to seperate singlr column information into seperate column based on the name in the Data 1 column.

Data1 Data2 Result 1 Result 2 Result 3

View 3 Replies View Related

Create Named Range Based On Column Values

Dec 30, 2007

I have a worksheet that has hourly data. So Column C of this worksheet looks like


What I want to do is, given an hour h, automatically create a named range that contains all the rows such that the value of Column C is equal to h.

View 9 Replies View Related

Create Worksheets Based On Data Groups In Column

Apr 10, 2008

I have a workbook that lists system analysts and information on the systems they're responsible for. I would like to have an Excel macro that will:

1. Create and name a new worksheet for each UNIQUE value in the 'Name' column (new worksheet for each analyst)
2. Copy their system info to each respective worksheet

I've attached a sample workbook.

View 2 Replies View Related

Create Order Form That Inserts Rows Based On Value In Column

Apr 11, 2014

I'm trying to make an order form that is based off of a price list. Basically there will be 200 items or so someone can just enter the quantity they want into a column. I would then like another sheet on the workbook to auto-populate all of the fields available. The thing I'm having trouble with is I don't want the finished form to be as long as the price list with blank rows in-between. I've been reading up to make a macro work for this, but have had no success.

View 3 Replies View Related

Automatically Create List Of Column Contents Based On Criteria?

Jan 15, 2014

I have a spreadsheet that lists dates in row 6, columns V through BE. We use these dates to log attendance for kids, so under each date there may be one of many symbols, such as "x" if the student was there. I would like to create a list of the dates that meet one of two criteria: either blank or containing "WR". So, let's say column Z is blank and Y has "WR" in it. In column FB I would like a list of all of the dates that were blank or WR, so I would want the dates contained in row 6 for Y and Z. Is there a function that will 1) look for a blank or WR across a row, 2) find the associated date for that blank in row 6, and 3) write the in another column in the form of a list, each date separated by commas? Here is an example of my information. I would like for a function to automatically make the list in column FB for any dates that are blank or contain "WR".



List of Dates Absent



1/23, 1/24


View 2 Replies View Related

Create Column To Show Month Only Using Date Column As Reference

Jan 16, 2013

I have a spreadsheet with a column showing dates (dd/mm/yyyy). I need the column next to it to display the month only (Jan,Feb etc).

How do I create a column to show the month only using the date column as a reference.

View 5 Replies View Related

Every N-th Cell Value From A Column And Create Another Column Consisting Of Every 4th Number

Nov 5, 2008

I was wondering, is there a function that would take, lets say, every 4th cell value from a column and create another column consisting of every 4th number ?

View 2 Replies View Related

Create Sequence - Put Order In Second Column Of Item That Is In First Column

Dec 28, 2011

I need to put the order in the second column of the item that is in the first column.

In the last line item Computer is recorded for the third time.


View 2 Replies View Related

Create A Formula To Add Values Assigned Cumulative Dates In A Month

May 12, 2009

I have a variable list of items in date order, there could be one, more than one, or, no items for any one date Each item has it's own line. I need a formula in a separate column (column F) to total each day's items. Column A includes the Date. Column F is a cumulative total (as in Column C) for items on the same date. Column C=D+E. I am looking for a formula which will add up items in column C if they have the same date in column A, and put the answer in the last cell in column F for that date. Example........................

View 5 Replies View Related

Excel 2010 :: Create Pivot Table To Gather Cumulative Amount From Data Sources

Nov 30, 2011

I'm trying to create a pivot in 2010, which gathers a cumulative amount from data sources within two different worksheets.

View 2 Replies View Related

Merge Two Workbooks. Copy Column Data Based On Numerical ID Match Of Another Column.

Mar 13, 2009

I am trying to get excel to search a workbook/(or worksheet if easier) for a matching unique value and fill in its associated data. My first workbook has the SKU (A) filled in but not the UPC (B). My second workbook has both the SKU (A) and the matching UPC (C) filled in.

I need to take both workbooks/(worksheets), compare the SKUs, and if a matching SKU is found, extract the UPC from Workbook 2 and fill in the UPC field in Workbook 1, and if no UPC is present in Workbook 2, then it leaves the cell in Workbook 1 blank.

View 2 Replies View Related

Formula To Pull Latest Date From One Column Based On Entry In Adjacent Column

Jun 6, 2014

Any way to construct a formula in excel that will look at a reference in one column and find the latest date from the data in an adjacent column for that specific reference?

Below is an exctract from a much larger sheet of the columns in question.

The result in the last column should be 21/05/2014 for anything with D.O.001 in the second column and 15/05/2014 for anything with D.O.002.

Date Decision agreed
Disposal Order
Latest Decision date for D.O.


[Code] ........

View 6 Replies View Related

Creating Validation List From Table Column Based On Data In Another Column

Dec 11, 2013

If I have a table as noted below with the following assumptions:

- this table will likely grow
- the 'Include' column data will change based on external criteria/formulas, so the 'Include' column will not be sorted.
- Macros aren't an option as this sheet needs to be macro free.



How do I build a formula that I can place in a data validation drop down to only include 'Item's that have Yes indicated in the 'Include' column?

I've been researching this and found answers if the 'Include' column was sorted via offset, but I haven't found any to sift through when unsorted. I feel like there is a simple answer to this that I am missing. Here is the sheet --> ExampleSheet.xlsx

View 1 Replies View Related

Range Object/property: Calculates 2nd Column Based On 3rd Column's Number

Jun 1, 2009

I'm trying to write a code that calculates 2nd column based on 3rd column's number or vice versa based on the condition set on the 1st column. Below, there are two procedures. "SimpleCalc" and "SimpleCalc2". I first wrote SimpleCalc2, but it isn't working, so I worked around the error by writing SimpleCalc, which selects a cell and moves around by offset. I personally find it hard to read and error prone as I develop more logic around it.

I'm trying to develop more function based on this code, so I need to make it neat and flexible. what I'm doing wrong in SimpleCalc2? Or do you have any suggestion to improve the code "SimpleCalc"? I'm using Excel 2003.

Sub SimpleCalc()

Dim SimpleMethodRng, SimpleMethod As String, i As Integer


SimpleMethodRng = ActiveWorkbook.Worksheets("Dashboard").Range("N5:P12")

For i = 1 To 8

SimpleMethod = SimpleMethodRng(i, 1).........

View 3 Replies View Related

Calculate The Average Of A Group Cells In One Column Based On The Condition Of Another Column

Oct 2, 2008

I'm trying to figure out if there is a formula I could use that will calculate the average of a group cells in one column based on the condition of another column. It's hard to explain, so I will show an example. All the data is on a one worksheet and I'm trying to show totals and averages on another worksheet. Location, Days

17, 4
17, 3
17, 5
26, 4
26, 8
26, 10
26, 7

On a different worksheet I would want to know what the average days are for each location. So is there a formula that I could use that will look at column A for a specified location number and then average all the days in column B for that location? I'm using Excel 2003 and have tried using the Average(if) but with no success.

View 2 Replies View Related

Excel 2007 :: Autofill Column B With Sequential Values Based On Value In Column A

Nov 27, 2011

Autofill column B with sequential values based on whether value in column A changes its value.

I would like to autofill column 'B' with sequential values (i.e. GenoMap1, Genomap2, Genomap3,... GenoMap10, GenoMap11, GenoMap12,... GenoMap104, GenoMap105, etc...), but changing to the sequential GenoMap# only when the value in column A changes.

This is what I imagine.

A1 "Alfiero", B1 "GenoMap1"
A2 "Alfiero", B2 "GenoMap1"
A3 "Alfiero", B3 "GenoMap1"
A4 "Allocati", B4 "GenoMap2"
A5 "Amaranto", B5 "GenoMap3"
A6 "Amaranto", B6 "GenoMap3"
A7 "Amaranto", B7 "GenoMap3"
A8 "Ambrosiano", B8 "GenoMap4"
A9 "Ambrosiano", B9 "GenoMap4"
A10 "Ambrosiano", B10 "GenoMap4"
A11 "Ambrosiano", B11 "GenoMap4"

I listed examples above of GenoMaps higher than 10 and 100 to show how I need them numbered.

I'm using MS Excel 2007 in Windows 7.

View 2 Replies View Related

Formula That Counts Unique Dates In Column Based On Another Column Value?

Jan 8, 2014

How would I count unique dates associated with another specific value on a worksheet?

For instance, Lets say I want to count each day a particular person makes a sale.


Sales PersonSale IDSales Date
Don 1001/6/2014
Don 1401/7/2014
Don 1601/8/2014
Jack 1011/6/2014
Jack 1021/6/2014
Mike 901/5/2014
Mike 1031/6/2014

So on another worksheet, I'd have:

Sales Person Days with Sale
Don 3
Jack 1
Mike 2

The Formula would go into the "Days with Sale" Column.

View 2 Replies View Related

Copyrights 2005-15, All rights reserved