Automating Data Import And Calculations
Mar 31, 2009
I have a huge database of textual files all of which have the same format - space separated text files. I need to find the average of the last column of all these files.
Each file is named uniquely. Is there an stress-free way to set up an automated procedure to go through each of these files automatically and to record the average of the last column along with the name of the file. I attached a few text files - these are daily prices of a few securities. The last column is Volume. I need to find and record the average of this column for each of these files.
The text files are here:
[url]
View 9 Replies
ADVERTISEMENT
Apr 25, 2014
What I do at my job is schedule production runs for bakery items. these items consist of many ingredients that go into them (Flour, Sugar, etc.) The products go into the run at certain percentages (20% of the run is flour, 30% is eggs, 15% is Sugar, etc) Many times we will have two or more types of a product, sugar for example. between the different types they can all have a different cost per pound, so what we try to do is use the cheapest stuff first to save money. So for part of this excel sheet what I would like it to do is to automate what percentage I should use the sugar based on cost. the total percentage for the sugar would add up to 100%.
for the second half of this sheet, there is another variable to account for. for this product we also need to hit target specifications so the product will be ok to sell. The example is Protein in this situation. we have a target protein that we need to hit per serving of 24.2 grams. I have the file set up to convert the protein percentage to protein per serving in grams, so that is already done.
my problem with this sheet is I can only seem to do one or the other. I can set it up to use the cheapest product first and add up to 100%, but it won't hit the target protein. Or I can have it set up to hit the target protein, but then I won't hit the 100%, it's be above or below. I need it to account for both variables and then give me the suggested percentages.
So is there a way that I can have it formulate what percentage to use something at to hit a target and equal 100%?
tl;dr I need to account for two variables. hit target protein, and have the total percentage equal 100%
View 1 Replies
View Related
Jul 25, 2008
I have a large number of sheets with data in the following general format:
x ..... y ............ z etc
A Unique value Unique value
A Unique value Unique value
B Unique value Unique value
B Unique value Unique value
C Unique value Unique value
C Unique value Unique value
D Unique value Unique value
D Unique value Unique value
E Unique value Unique value
E Unique value Unique value
In seperate sheets, I want the following:
x y1 y2
A
B
C
D
E
x z1 z2
A
B
C
D
E
And so on for a number of columns - I always want column "x" with another column, however I want the two values for the same value of x to be next to each other, not above one another.
View 11 Replies
View Related
May 6, 2009
Just wondering if any one can help me come up with some code to remove some lap time in my document ....
View 14 Replies
View Related
Feb 12, 2014
I'm currently trying to automate the process of creating Data Validation.
PFA.
I have Grades and Names List.
" GradesList " Range has values "One, Two, Three, Four "
I'm trying to map Names List to GradesList using INDIRECT().
Debug the function DataValidation() to understand the issue better.
View 7 Replies
View Related
Mar 5, 2007
Automating Data Filter Autofilter. i would like to automate the autofilter (from a form)...the following code works, but...it needs improvement...
myfilter = Range("d2").Value
Selection.Range("testmonth").Select
Selection.AutoFilter Field:=1, Criteria1:=myfilter
View 4 Replies
View Related
Jul 21, 2014
I need to take data from spreadsheet Control Master.xlsx then apply calculations from another one Calculations.xlsx and record results to the first spreadsheet.Data to be taken from Control Master.xls columns C, D, E. After calculations results (Calculations.xls columns Q, R, S) to be recorded back to Control Master.xls columns F, G, H.
View 4 Replies
View Related
Mar 8, 2012
As a complete novice....I want to:
1. Create a list of 3 different types of projects
2. Write three different types of calculations that should be undertaken dependent on the type of project. Each will be in a separate worksheet.
3. Make sure once I've checked the project type I apply the right calculations that match the project type
4. Summarise the results of the calculations against each of the projects
Can I do this just in excel or do I need to use macros?
View 9 Replies
View Related
Mar 27, 2009
I have 2 sheets - one called 'Lookup' that has a table of recipes in the rows and ingredients in the columns. The cross reference of each is the required quantity of that ingredient, if any (obviously..). Both rows and columns are sorted alphabetically.
In the second sheet - Recipe - I have a subset of the recipes (e.g. 'Cakes') along with the applicable subset of ingredients. I've input these by hand, so I assume they can be referenced directly in the function. What I need to do is grab the quantity out of the table for each recipes ingredient. E.g. A6 will have the recipe 'Jamrolypoly' and H1 will have the ingredient 'Jam'. H6 needs to return the value from the table in Lookup.
I'm still (very) new to this but looking around I found the following which seemed to describe the function I am after:
=VLOOKUP(H1, Ingredients, MATCH(A6, Ingredients, 0))
(Ingredients is the name of the table in the Lookup sheet)
I then need to be able to use the returned values in separate equations on sheet 2 to work out costs. This bit I've done already but I've heard that some of the methods of data retrieval return 'N/A' if there is no value, and that would not allow any subsequent calculations using the value.
View 4 Replies
View Related
Nov 4, 2012
(Excel for Mac 2011). The size of my data means am crashing by usual methods of sorting - I need a formula for this rather than pivot tables.
I have a list of c. 40,000 rows. Col A is client name (largely different but some duplicates); Col B is Policy type (eg Home, Motor, Travel) and Col C is earnings on that policy (eg -60). An example would be:
Name
Policy Type
Earnings
Johnson
Home
[Code]...
So I need to figure out (via a formula) two things:
1) How to count duplicate names (eg appearing 3x = 1 customer; appearing 2x = 2 customers; appearing 1x = 1 customer)
2) How to build a simple table to show the relationship between policies. This would have Motor, Home, Travel, Motorcycle as columns and also as rows - the data would then be how many policies and in each cross point?
I have tried just working the data using Countifs etc, but as soon as I apply it to the whole data set the machine freezes, presumably due to its size
View 6 Replies
View Related
Sep 4, 2006
I have a program that calls the regress function multiple times (sometimes more than 1,000) per run. With each call to the regress function, a new workbook is automatically opened. For each new workbook opened, I am storing the contents in a workbook array called Models so I can later sort the workbooks based on the value of R squared. The program often has to open and store hundreds of workbooks before the sorting can take place so as to consider every possibility. Once the sorting has completed, I close all of the open workbooks except for the two containing the largest value of R squared. Due to the massive amounts of workbooks getting opened and then later closed, it takes about 30-40 minutes to run my program.
I want to know if after a new workbook has been opened and its value stored in the Models array, can I immediately close it and then later open only the 20-30 workbooks I really need to speed up run time? This way I wouldn't have hundreds of workbooks open at one time. Here's some code to help:
'This function will run regression stats for all possible combinations of models
'with choose variables
Private Sub Run_Stats( Combos, ByVal Size, R_Squared, Adj_R_Squared, Std_Dev, Cp_Stat, ByVal Dep_Var, ByVal NumIndepVar, ByVal Observations, ByVal Choose, Reg_Labels, ByVal Residual_Sum, Models)
View 9 Replies
View Related
Sep 22, 2006
I am having problems with calculations to be performed on date format. As in attached excel sheet, Start Date and End Date can be defined by the user. Once the user enters the dates, year 0 onwards are to be populated with values so that: (Also, not sure if I will need a button to initiate the calculations or a direct function will suffice)
year0 start = Start Date,
year0 end = (Start Date +12 months) or (End Date), if End Date is before (StartDate + 12)
year1 start = year0 end,
year1 end = (year0 end + 12 months) or (End Date), if End Date is before (year0 end +12)
year2 start = year1 end,
year2 end = (year1 end + 12 months) or (End Date), if End Date is before (year1 end +12)
year3 start = year2 end,
year3 end = (year2 end + 12 months) or (End Date), if End Date is before (year2 end +12)
year4 start = year3 end,
year4 end = (year3 end + 12 months) or (End Date), if End Date is before (year3 end +12)
year5 start = year4 end,
year5 end = End Date
If the dates are such that all years 0 to year 5 may not be covered, the years not used should be blank.
View 4 Replies
View Related
May 27, 2014
how to calculate averages and standard deviations based on different time periods without having to manually change the cells?
example:
1st average output at z3, 1st std dev output at z4
data to calculate from c3:c50
2nd average output at z5, 2nd std dev output at z6
data to calculate from c51:c98
3rd average output at z7, 3rd std dev output at z8
data to calculate from c99:c148
and it goes on based on this sequence. i would like to know how to do this without having to change the cells each time i want to calculate. basically what is the quickest way to calculate following this sequence?
View 6 Replies
View Related
Sep 5, 2013
I have built a model which has approx 33,000 different combinations (output) based on user selection. There are 15 different options for user selection which gives rise to the number of outputs (2^15 -1) = 32,767.
I have inbuilt a data table that gives the output for all of the 32,767 scenarios. However, it seems like for each change the calculations takes forever and I am not sure when the calculations are complete. Saving takes forever and stuffs up excel. The numbers keep changing in front of my eyes. The file is 10Mb big/small.
View 3 Replies
View Related
Feb 25, 2014
I'm looking to do some simple maths with ranges in Excel but I'd like a way to be able to input all these formulas automatically although I am pretty sure a single formula per column could do it all automatically. I've got to put the sums in AD to AF on the first line of each location, but the maths is for the entire location's range.
[URL]
View 3 Replies
View Related
Mar 2, 2012
I want to be able to run a macro that will export some of the data from a worksheet called Generated Report into another worksheet called Matrix. The data will be taken Generated REport and grouped into sections of the worksheet. These sections will be defined by the BRID value.
The Data that i want to export will be from the first 5 columns within the Generated Report(note there are other columns which data is not required from).
The following columns will be exported from Generated Report -
BRID,Requirement, Bug Description, Bug ID and Alt Bug ID.
BRIDRequirement Bug DescriptionBUG ID Alt Bug ID
PQ115 PQ115-Login Bug Description text xihllloloj43712 123
PQ116PQ116-Landing Bug Description text ghghghgoot 43713 126
For Matrix
The data will be imported into Matrix worksheet into the following columns as part of the row headings
- Requirement, Description, Bug ID and VF Bug ID.There will also be other columns (outlined below) which i will use to manually enter data
The data will be grouped and imported into the relevant section by its BRID eg PQ115, PQ116 etc.
I want each section (marked by BRID number)to be separated by row headings.
These row headings are to be generated after populating all data within each BRID number.
When the data has been populated in each row there is a column called 'Status' which contains drop down list boxes which can be assigned.
The default status will be set to 'To Do'. The complete row headings are displayed with Output from Generated Report underneath
BRID Priority Requirment Description BugID Alt Bug ID PC UpdateNotes Actual Result Type of DEfect Test Status Tested by
PQ115 PQ115-Login Bug Description text xihllloloj43712 123 To Do
BRID Priority Requirment Description BugID Alt Bug ID QC UpdateNotes Actual Result Type of DEfect Test Status Tested by
PQ116 PQ116-Landing Bug Description text ghghghgoot43713 126 To Do
So far the macro that i have been using allows me to locate the data for each specific BRID in Generated Report and copy into the corresponding BRID section within the Matrix. I have to repeat this step for each new BRID and i want to be able to whole automate this process.
View 5 Replies
View Related
Feb 4, 2009
I have the following data retrieved via import data tools ...
View 9 Replies
View Related
Jan 22, 2014
i attach the file so you can look after you read
i have soccer table 1 sheet is "teams" which is the table of the league. 1 sheet is "games" which is the table of games of the league the last sheet called "import by date". in the end of every game day i sent email with the results of current day. for now im copy and pate all results and its not that easy and convenient. i want to make some formula that when i click in import data sheet the date its shows me all the results from that date. i try to do it with pivot table but didnt like how it displayd
View 2 Replies
View Related
Jun 20, 2014
I have a tedious task of copy/paste from our website. have a look at below sample data. I have around 1500 rows of data like this.
Sheet1
A
B
[Code]....
Column A has input data which i need to copy and paste in a web form. Column B will have results scrapped form webpage[ URL]. This webpage will need login details
If a code can be written which take value form column A of spreadsheet and paste in webpage like shown in above image and hit search button. Next webpage will be loaded with number of results like shown in below. Take the number of results and paste in column B of spreadsheet.
View 1 Replies
View Related
Jan 29, 2008
I'm attempting to import around 200 (and growing!) separate text files into Excel. I am using the formula below to import the text file and then using a separate macro to select the information I need, copy it into another spreadsheet, and then run the import macro again.
However, I have a problem in that my import macro gives me 'Run-time error '1004:
Application defined or user defined error''. At first this wasn't a problem as the information is pasted into the spreadsheet despite the error anyway. However, now that I am looping the macro it is obviously causing more problems as it prevents the loop. I would really appreciate it if anyone knows of a work-around or can spot an error in the coding to resolve this!
The code below shows is for the import macro only:
Sub ImportTextFile(FName As String, Sep As String)
Dim RowNdx As Long
Dim ColNdx As Integer
Dim TempVal As Variant
Dim WholeLine As String
Dim Pos As Integer
Dim NextPos As Integer
Dim SaveColNdx As Integer
View 8 Replies
View Related
Mar 18, 2004
I found a template at microsoftofficeonline.com it's just a bracket. I feel it has some underlying functionality, as they have a template in visio as well, but I can't figure it out.
So, what I'd like to do is have a workbook with say 100 worksheets. Each worksheet will have a person's bracket. Each person will write in all their picks. Their will be a master bracket where the actual winners will go, as the results are posted. When the master bracket is updated, Excel will flip through each worksheet, checking to see if the win in the master bracket matches the individual bracket. Points will be awarded or not.
Can that be done? I've also done a google search and can't get anymore help. I know that the web has multitudes of free versions, which I'd use, the only problem is that people would hesitate to register. doing it in excel, on the office system, there's no need to register, your cpu login takes care of authentication.
View 9 Replies
View Related
Jun 30, 2006
I'm trying to make alot of graphs(400) and I'm not really sure where to start but here with what I've got so far.
Sub macro2()
Dim x As Long, t As Long, y As Long, z As Long
y = 3
z = 5
x = 4
While x < 1000
With Worksheets("cabernet (2)")
t = Cells(x, 1).Value
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("cabernet (2)").Range("By:Hz"), PlotBy:=xlRows
ActiveChart.Location where:=xlLocationAsObject, Name:="Cabernet (2)"
ActiveWindow.Visible = False
ActiveChart.HasTitle = True
ActiveChart.charttitle.Text = " " & t
Windows("complete Favorite Genes.xls").Activate
y = y + 3
z = z + 3
x = x + 4
End With
Wend
End Sub
I don't really know if putting a variable directly into a range works, so far it doesn't.
As you can tell I need a line graph of the range B3:H5, then the next is the those same columns but 3 rows down, so the next graph is at B6:H8. I'd also like to through in a title here, but I may just be playing with fire. The title is located in column A starting at 4 and corrosponds with each graph, so it too goes is increments of 3, i.e., the first title is at 4 the second at 7 the third at 10. Somebody help me out this isn't working very well at all.
View 5 Replies
View Related
Sep 16, 2006
Private Sub Database_Click()
Application. ScreenUpdating = False
masterfile = "S:OfficeMaster File.xls"
Answer = MsgBox("Do You want to export to Final Database?", Buttons:=vbYesNoCancel)
If Answer = vbYes Then
ThisWorkbook.Worksheets(2). Range("q9").Copy
masterfile.Worksheets(1).Range("a4").Paste
ThisWorkbook.Worksheets(2).Range("q9").Copy
masterfile.Worksheets(1).Range("d4").Paste
ThisWorkbook.Worksheets(2).Range("b3").Copy
masterfile.Worksheets(1).Range("b4").Paste
ThisWorkbook.Worksheets(2).Range("b9").Copy
masterfile.Worksheets(1).Range("c4").Paste
ThisWorkbook.Worksheets(2).Range("e9").Copy
masterfile.Worksheets(1).Range("e4").Paste
ThisWorkbook.Worksheets(2).Range("g9").Copy
masterfile.Worksheets(1).Range("f4").Paste
ThisWorkbook.Worksheets(2).Range("i9").Copy
masterfile.Worksheets(1).Range("g4").Paste
End If
End Sub
for some reason, it doesnt work as it said the masterfile.worksheets is not recognized, but as i go to the immediate thingee, i type in ?masterfile, it give me the exact address, i had been working on this thign for hours, and have no idea what i did wrong.
View 3 Replies
View Related
May 7, 2007
I have a very peculiar problem. Each month I have a set of financial products for which I calculate the IRR values using XIRR, as the cash flows are uneven. Imagine this, Product names in ColumnA, the cashflow dates in B, and the cash flows with transaction types in ColumnC and finall D has amounts in negetive and positive. Each month I add new cashflows for each product as rows.
Manually I scroll down to select the range for XIRR (both date and amount)
Offlate this work has gone really high in terms of values, and manually cacluating XIRR takes hell lot of time for all the products (currently 80 odd)
View 9 Replies
View Related
Dec 11, 2009
The attached workbook is a follow up report that gets run every Friday. There are 1092 cells that contain formulas that reference a file that was created on Wednesday of the same week. eg.
View 5 Replies
View Related
Jun 11, 2007
I am trying to do is have the code display an input box asking the user to type in the file name, or generate this automatically? to an existing folder in a drive
My master file, imports data from another source (excel file) pastes it in the necessary columns at the moment, however the file is run every Monday so the file name is generic, last week was 10723, this week will become 10724 when the data is run next week,
Can I do what I want to? Via either an inputbox for the file name, or by using something so the file name becomes “107 “ & Weeknum(today()-3)
View 9 Replies
View Related
Mar 16, 2008
I have 1 spreadsheet in which I need to calculate the % weight of some numbers. Columns A to G have data I do not need for the calculation.
Column H has the numbers of whose % weight I need to calculate. The problem is that the no. of rows containing the numbers can change from week to week and I am trying to automate the calculation of the % weights.
So I want try to use column G (as a reference) (like go at the bottom of it so I can know how many rows of numbers there are) and then calculate the % weights.
View 9 Replies
View Related
Apr 30, 2008
I am trying to use Excel VBA to conduct a transaction automatically.So far,I managed to get all the required input in.Now,I need to click the "Submit" Button.
I was thinking of using the InternetExlorer.Document.Links(x).Title to search for the link of the "Submit" button and then use the .Navigate method to proceed to the link.
But when I wrote and ran the :
InternetExlorer.Document.Links(x).Title
i get the following mesage:
"Run Time Error 98
A property or method cannot include a reference to a private object ,either as an argument or as a return value "
View 9 Replies
View Related
May 16, 2008
I have a spreadsheet which i work on everyday, basically I have a formula which needs to be copied in the second column depending on the range in the first column.
Ex : one worksheet will have A1:A100, the B column should be copied to B1:B100, if the next one has A1:A200 then B column should be copied to B1:B200, how to do this with VBA?
View 9 Replies
View Related
Mar 4, 2009
My spreadsheet is linked to a stock data web page using the little documented .iqy function. I have set cell A1 to the web page ticker symbol, so that whenever this cell value is changed the data in the spreadsheet is automatically updated.
My problem is in several parts:
1. Read TickerSymbol.csv file which is comprised of just ticker symbols,
2. Insert (TickerSymbol.csv) symbol 1 into cell A1,
3. Save the results to a file c:XXXSymbol1.csv,
4. Insert (TickerSymbol.csv) symbol 2,
5. repeat, repeat
View 9 Replies
View Related