Macro For Picking Out Trends In Data
Dec 21, 2011
I am trying to write a macro that will automate the process of selecting rows from a data sheet. I want the rows to be selected based on the values in two columns. I want to find and select the row at the beginning and end of positions in a column where the values are equal. For a quick example, if my data looks like this below, I'd want to select the entire row for rows 2,3, and 6... I also need the row just before the value in both columns are equal.
row column11 column12
1 0 1
2 0 1
3 1 1
4 1 1
5 1 1
6 1 1
7 0 1
8 0 1
I have written this macro and it is not working... are there any obvious problems with this? This is new to me and I'm not exactly sure that I've used the correct commands. It also seems like LastRow is referencing 0 and not 12965 or whatever the last row of filled data is for the sheet.
Sub Deltadata()
Dim RowNum As Long, LastRow As Long
LastRow = Range("A" & Rows.Count).End(xlUp).Row
'Finds last filled row (should be 12965)
For RowNum = 3 To LastRow Step 1
[Code] ........
View 4 Replies
ADVERTISEMENT
Sep 11, 2012
I'm trying to take 5 inputs that are all in text format and inputs have fixed options what i need is a macro that will take them and turn them in to the relevant outputs. there is a select amount of combinations and i've been asked to do each combination as a separate macro or sub macro.
What I have so far is;
If C6 = "Panel plate" And D6 = "24 by 21" And E6 = "<1.59" And F6 = "N/A " Then I6 = "120" And j6 = "4" And L6 = "120"
End Sub
A B C D E F G H I J K L
1
2
4
5
6 Panel plate 24 by 21 <1.59 N/A
7
8
9
10
(Doesn't seem to work)...
If those four cell match up then i need I6-L6 to line up with whats required.
If they don't equal that i need it to stay clear.
I also need to add the same macro with different options.
View 7 Replies
View Related
Apr 2, 2014
The purpose of the attached workbook is to calculate the average number of days a customer takes to pay their invoices. There are two tabs - Invoices and Payments. I am trying to calculate the number of days between Invoices "Sales Date" and Payments "Settlement Date".
The Payments tab is raw data exported from Attache financial system as CSV. It is the best I can get out of the system but the columns are all over the place.
I thought maybe from the Invoices tab I could search a row on the Payments tab to match the invoice number, find the cell containing the phrase "Invoice Number" then pick up the date from the following cell which contains the Settlement Date . This would be straight forward if the data from the CSV file consistently landed in the same column in the Payments worksheet, but it doesn't. As you can see, the phrase "Invoice Number" might appear in any one of several different columns.
View 5 Replies
View Related
Feb 4, 2008
I have Workbook with numerous worksheets,on one particular worksheet i require a formula/macro code that will pick up (say) those cells highlighted in red and then transfer that data set and the other selected information on that row to a another worksheet within the workbook.
E.g
Sheet 1 contains columns A to J;
Sheet 2 is where i require the information which is highlighted in red to be uplifted and pasted too.
so if Cell B2 contains the highlighted cell how would i uplift and transfer this along with data in cell C2,H2,I2 and J2 automatically to sheet 2.
View 9 Replies
View Related
Aug 1, 2008
I'm using the following formula to pick up data from another worksheet
=SUMPRODUCT(--(RawActuals!$A$1:$A$10000="jun"),--(RawActuals!$E$1:$E$10000=A236),RawActuals!$M$1:$M$10000)
It's picking up most of the data, but it's missing some - and it's to do with formatting of SOME of the data within the RawActuals sheet
212605Agency Staff - Professional & Other212701Staff Cost Tfr to Change Programme221112Property Rents - Passing Rent221310Hire, office/courtr'm/related eqpt
The 1st, 3rd and 4th lines are correctly picking up the data - but the 2nd is not. They are all set to the same number format.
View 9 Replies
View Related
Oct 13, 2013
last item in we 13-9-2013 is 13-9-2013
last item in we 20-9-2013 is 13-18-2013
last item in we 4-11-2013 is 30-9-2013 as shown in the attached
1.jpg
View 2 Replies
View Related
Jul 22, 2014
I have a series of spreadsheets that represent the rosters of teams in a league. At the end of the league season, some teams qualify to advance to a final event, and some do not. I start with a file of all the teams for that level of competition. This list comes from a program that creates it's output in an excel '97-2003 format (and I can't change the way the data comes out of this program). I modify the data a bit by removing data from merged cells and rename that worksheet a 'Raw Data'. In the past I have manually copied and pasted the data for the teams that advance to a sheet called 'Roster Data'. I am hoping there is a way to automate this part of the chore.
There must be 6 blank lines between the team names on the 'Roster Data' tab, but some teams have more members than others, so they are not spaced the same on the 'raw data' tab. Is there a way to select teams from the 'Raw Data' tab and have only the selected teams show on the 'Roster data' tab, AND have the spacing become uniform?
View 13 Replies
View Related
Jul 29, 2009
i need to populate a field to show the month and year as follows: the data is entered in one field like this: 01/09/2006. i need another field to populate this: Jun 06. i have tried to use a few formulae but to avail. look forward to your response
View 4 Replies
View Related
Mar 10, 2009
I am using the following formuale to pick up a numeric value (from column G in Feb09 sheet: =INDEX(Feb09!G:G,MATCH($A10,Feb09!$B:$B,0))
Trouble is, the match it's doing in column b in Feb09 is listed twice in the sheet, but i'm only picking up the data for the value in the first line ... i think i need a sumif function.
View 2 Replies
View Related
Aug 12, 2013
I cant seem to figure out why this sumproduct formula wwill not pick up the datatable on a separate tab. Data table is Column E to AA but it only goes to Column Y. If I try putting AA in - the formula returns the VALUE#. I thought it maybe the cell formatting but it does not seem to the problem.
=SUMPRODUCT((Worksheet!$C$3:$C$57>=$H$12)*(Worksheet!$C$3:$C$57
View 1 Replies
View Related
May 2, 2014
I used three different dates. In which the outcomes were available. The first three sheets.
Is there a possiblity to use excel to calculate a future outcome of the next month(Sheet 4). The figures are in a way linear, because the previous months are in it.
So it's possible for the future outcome to go up or stay the same. It can't be less then previous months.
See attachments.
It's about a holiday (combinations) of arrangements. So it'll be influenced by the date (because of holliday plannings), finance etc etc. But the last factors/variables we will use and test in SPSS and other programs.
The question is more: Is there a program/formula in excel which will predict the outcome in the last sheet with maybe a factor of outliners (this coincendence of a better salary in some parts/or the date that people will book a holiday). And how the formula would be formulated in the last sheet?
View 2 Replies
View Related
Nov 21, 2008
I have revenue sheet that spans 12 months kind of looks like this:
0 | 240 | 261 | 0 |317 | 0 |0 | 0 | 0 | 0 | 0 | 155
So that is 1 row, my problem is I have about 8 thousand of these, and what I'm looking for is trends in lapsed accounts (accounts with no spend, the "0's"). As you can see I have 6 zero's in a row, which means this customer was lapsed for 6 months.
I want to run something that will find the average of zero's in a row for all 8,000 rows. For example one customer has 6 zero's in a row the other one has 3 zero's in a row so the average would be 4.5. I only care about zero's in a row.
View 3 Replies
View Related
Oct 19, 2009
I am trying to show some trends, from data taken on a monthly basis. The attached spreadsheet is an example of what I have:
The first two columns show data for Month1. The next two columns show data for the last 2 months (Month1&2). I was thinking of using a line graph, and showing Month1 and Month1&2 on the X axis. At time Month1, I'd have 4 different data points, for hw, sw, fpga and chip. At time Month1&2, I'd show the cumulative data for those same 4 categories. Over a period of time, we could see whether one area or another (hw, sw) keeps getting worse. How can I do this via pivot table?
View 3 Replies
View Related
Jan 17, 2014
I am writing a VBA for downloading a csv file from google trend.
In the first worksheet ,enter the search keyword in the excel file and the click a button to download the csv file and place it in another worksheet in the same excel file.
I have had some experience with downloading the stock stat. csv file from yahoo but then I realize this time is really a different story.In the google trend case, I cannot find a real URL of the csv file.
I strongly believe the solution is on [URL] .....
I have tested the code in #1 .It runs but cannot return a proper csv file just like Lloyd said. I do not understand what Kyle said. What do title and id refer to ?
Besides,I do not understand and cannot run the code in #6.
What is the input and output of this code?
When I run this, I face a Run- time error '-2147024891(80070005)'.
View 2 Replies
View Related
Aug 7, 2014
I need to conditionally format a cell to:
-return red/yellow/green when the value is below/above or within range of targets but dependent on an increasing or decreasing trend.
If the trend is decreasing and the value is above the target is should return red.
If the trend is increasing and the value is above the target is should return green.
For all there is a Threshold.
For example:
Value Target Trend TrafficLight
(A) 79% 90% Increasing RED
(B) 69% 70%-90% Withing Range Yellow
(C) 85% 90% Decreasing Green
Thresholds:
for example (A) - Red: <80%, Yellow: 80%-90%, Green: >90%
for example (B) - Red: 60-90%, Yellow: 50-60%;90-95%, Green: <50%;>90%
for example (C) - Red: >80%, Yellow: 80-90%, Green: <90%
View 1 Replies
View Related
Jan 15, 2013
I am using google spreadsheet to gather survey data:
The spreadsheet looks like this:
[Code] ....
Is there any way to compile the information and create a line graph to display the trend of A and B over time?
View 4 Replies
View Related
Nov 29, 2007
I have 200 items that have 22 months of usage information each and need to:
1. In one column, show trend (up or down) based on the 22 months' activity for each item.
2. In another column, show/ forecast how much inventory will be needed for the next 12 months.
View 9 Replies
View Related
May 4, 2007
Column A is the COB Date Column B through N are various stock data. I would like to calculate the trend of correlations over a 4 year period. I can't seem to figure out how to manipulate the data analysis tool pak to do this.
View 3 Replies
View Related
Oct 6, 2008
I work in school which for example offers 20 courses for every student. Therefore I have a spreadsheet which has students name in A and B then the 20 courses spread from C to V.
Each student will study 3, 4 or 5 of the courses and will have value in the corresponding column (their teaching group) the rest of their row will be blank.
For each student create in columns X, Y , Z, AA and AB I would like to be able to pull from the 20 courses those which the student studies. Therefore finishing up with C to V hidden and just the student names and the 3, 4 or 5 courses they study.
Any ideas? if one method is to get them into one cell how do I get them into the 5 columns; i know DATA : Text to Columns but won't have anything to Delimit it with and can't use Fixed width as students will study subjects with different length charactors.
View 6 Replies
View Related
May 20, 2014
I have a table, which has pairs, e.g like this:
A=1
B=2
etc
how to give the value to variable based on this pairs? I mean something like this:
If left(mystring;1)=A, then
myvar=1
I used the case-structure, but maybe there is a better solution, which can use an array in order not to write all of the items whenever I need it.
View 9 Replies
View Related
Oct 21, 2009
I've created a useform for recording stock trades. So it asks the user to enter values for
"Date of trade"
"Time of trade"
"Name of stock"
"Price"
Right now I'm using a calendar control I downloaded from
http://www.fontstuff.com/vba/vbatut07.htm and it looks good, but I'd also like to have an easy way for the user to select the time of the trade (in minutes).
Is there an easy way to have a time picker? Like a dropdown box maybe? I'd like to have date and time picked separately since the date will remain the same for a lot of trades but the time will always change.
I've googled it a lot and some people mentioned using the datetimepicker Access add-in but I'm not sure if that's right for me. Also, I'm using Excel 2007 but the form will also be used on excel 2003 machines, will that affect the choice of solution?
View 3 Replies
View Related
Jan 5, 2012
I have a CSV file which contains a list of records about offices. This CSV file is generated from another program.
I read the CSV file with VBA, a SELECT * SQL statement which puts the elements into an Office Object and adds the offices to a collection.
For some reason, when one of the Telephone numbers is read it is being identified as a Null value. If I manually open the CSV file and change it to a different number e.g. 12345 and try re-read the CSV file with SQL VBA the number gets read fine. Every other element in the CSV file reads fine except for this. The number itself is 7736786460.
Attached is the small snippets of code to read the CSV file which is fairly straightforward.
Code:
Sub LoadUnits()
Dim oRs As Recordset
Set oFSObj = CreateObject("SCRIPTING.FILESYSTEMOBJECT")
'Open an ADO connection to the folder specified
Set oConn = CreateObject("ADODB.CONNECTION")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strFilePath & ";" & _
[code]...
View 7 Replies
View Related
Jan 5, 2012
Copied the below formula 1 column to the left - to pick up numbers 1 column to the left:
=IF(SUMPRODUCT(--(MOD(COLUMN(E7:AX7),3)=2),E7:AX7)=0,"",SUMPRODUCT(--(MOD(COLUMN(E7:AX7),3)=2),E7:AX7))
But the below resulting formula still picks up the same columns as the formula above:
=IF(SUMPRODUCT(--(MOD(COLUMN(D7:AW7),3)=2),D7:AW7)=0,"",SUMPRODUCT(--(MOD(COLUMN(D7:AW7),3)=2),D7:AW7))
View 1 Replies
View Related
Apr 10, 2014
I'm trying to use SUMPRODUCT as a sort of SUMIF/VLOOKUP hybrid. The following formula:
Code:
=ROUND(SUMPRODUCT('[12 GB BUDGET 15 V1 LOCAL VERSION.xlsx]
Revenue'!$G$3:$FM$3=$K2)*('[12 GB BUDGET 15 V1
LOCAL VERSION.xlsx]Revenue'!$G$27:$FM$27);0)
... should check for the value in cell K2 of the current sheet, compare it to all the values in row 3 of the Revenue sheet, and add up any and all values for those columns in row 27 where there's a match in row 3.
I don't get an error, but it's not adding anything up, either.
View 9 Replies
View Related
Sep 20, 2007
I have a excel file with names of employees and projects handled by them. In the 1st column is the name of employee and in the second column, its the name of the project. Every employee has approx 10-15 projects made by them.
I have another file with name of all employees in the 1st column. What is want is to insert the name of any two projects (taken randomly from 1st file) ahead of each employee.
View 9 Replies
View Related
Apr 26, 2008
I have a question that has been bugging me for a long time and an answer to it can be a big timesaver for alot of excel users specially accountants that do account reconciliations..
lets assume that I have 3000 numbers(amounts) listed on an Excel spreadsheet vertically, and i know for a fact that the sum of most of these 3000 transactions equal a certian amount..lets say $1,200,320.23,
lets also assume that all these amounts on the list are unique..
now..I want to isolate these numbers(amounts) that add up to that $1,200,320.23 by way of highlighting them or any other method. once that is done, I would be left with the amounts that are causing the descrepency in that account. I wonder if there is any function, utility or even VBA code in excel or even another software that can help solve that problem..I hope my explaination was suffecient, let me know if you need further clarification.
View 9 Replies
View Related
May 18, 2009
I have a column where some cells are coloured yellow. In another column, I'd like to mark out these cells, e.g. if the cell next to it was yellow, I would like to to display 'Y'.
View 9 Replies
View Related
May 3, 2007
I have a simple program that picks up an ID on sheet1, finds that ID on sheet2, picks up the information in one cell from sheet2, and brings that information back to sheet1.
The program works fine until for all IDs above row 570. After row 569 something strang happens. The programs is still able to find the ID but when it tries to pick up the one cell value it is saying it is blank yet you can physically see the data is present.
In all my years of VBA programming I have never encountered anything like this. Especially, where things work fine on half the worksheet and not on the other.
I am posting the code below, but I don't actually believe it is in the code. I cannot post the workbook because of the information it contains...
View 9 Replies
View Related
Oct 22, 2013
I have a long table like this:
Car,date last washed
Civic, 11/1/2012
F150, 5/4/2013
Corvette, 7/3/2013
If I washed the Corvette, I'd add another row to it:
Corvette, 10/22/2013
And I would like to remove the "Corvette, 7/3/2013" entry. What's the easiest (read: least user intervention) way of doing this?
View 2 Replies
View Related
Nov 7, 2013
I have a table like this:
Book, Loaned to, Date
A Tale of 2 Cities, John, 1/1/2010
Oliver Twist, Mary, 2/3/2011
Great Expectations, James, 4/6/2011
Oliver Twist, Greg, 6/2/2010
I want to make it such that, when I input the name of the book, it will tell me the person whom I lent it to last and the date of the transaction. Preferably, this should be done without any assumptions on how the table is ordered. For example:
Book= Oliver Twist
Loaned to= Greg
Date= 6/2/2010
View 2 Replies
View Related