Subtotal Sets Of Rows
Feb 10, 2007i have an excel sheet with columns including city & order value. i want to group rows with the same city name, and then subtotal the order values for each city. how do i do this?
View 10 Repliesi have an excel sheet with columns including city & order value. i want to group rows with the same city name, and then subtotal the order values for each city. how do i do this?
View 10 RepliesI have a code in software that exports results to excel. But it stores the numbers associated with indices as text. I need to change all of them to numbers. So I have written the following code, that search through the folder, converts text to numbers and colses the file.
Sub ConvertText2NumberFiles()
Dim v As Variant
Dim rng1 As Range, bk As Workbook
Dim i As Long
ChDrive "C"
ChDir "C: ...analysis"
[Code]....
The problem is it takes time becuase it is going through A LOT OF cells. I only need at most the first 4 columns and the first 2 rows. So I wanted to use the union. I wrote the following:
Set IndexColumns = bk.ActiveSheet.Range(Columns("A") & ":" & Columns("A").SpecialCells(xlLastCell))
Set IndexRows = bk.ActiveSheet.Range(Rows("1") & ":" & Rows("1").SpecialCells(xlLastCell))
Application.Union(Range("IndexColumns"), Range("IndexRows")).Select
Which doesn't work! Morover it is only for one column and one row.
NOTE1 : Like any matrix, the intersection of index columns and index rows is blank!
NOTE2 : The lenght of indices is different from one file to another
I have data from 100 trials. Each trial has a variable number of data points (rows), but each row is labeled in the first column with the trial number. I would like a macro to identify the first row of each trial, calculate the difference of the value of the cell in column G of that row from a constant (718), and then add that difference to that cell and all other cells in that column of that trial.
So based on the attached sample, I would like all values in column G for trial 2 to be +1, for trial 3 to be -5, and for trial 4 to be +2.
In the file, I've cleared all the data from the impertinent columns. Eventually, I will also want to perform a similar process on column H but with a different constant.
I have a problem with VLOOKUP looking in sorted lists of more than 16384 items.
Basically it fails at 16385th item
I have developed a VLOOKUP function that looks up in multiple tabs in
multiple files and returns a value. However I have discovered that it fails
at row 16385. As Excel copes to 64,000 rows I regard this as a bug. Has
anyone else encounteed this problem? is it just my machine, is there a
solution / bug fix?
If I use FALSE when the item to be found is beyond 16384 the function
returns the 16384th value this is a warning to other users who may not have
noticed as I did not initially.
--
I have an excel file which contains 2 set of data. 1 with 14 rows and other with 20 rows. These are randomly distributed in the sheet and are abut 1000 of data set in a sheet with a combination of 14 and 20 row data set. Data is separated by blank rows, i.e. if it is 14 row data set it would have a blank after 14th row and similarly a blank after 20th row for a 20 row data set. Following the blank another data set starts which might be of 14 or 20 again. I have attached a sample sheet for reference.
View 5 Replies View RelatedI have a sheet with a couple thousand rows of data. I need to calculate the subtotal sum for the first 50 rows of auto-filtered data. I can't seem to figure out the formula that I would need to have to do this automatically. If for example my filtered data the 50th visible row is row 1300, currently i can write a formula "SUBTOTAL(9,Q1:Q1300) but if the filtering changes I would have to go and change the formula to replace Q1300 with QX, where X is the new 50th visible row number. I know there must be at least one way to do it automatically but it seems to be beyond my current skill level.
View 3 Replies View RelatedI have a large file and I am doing a subtotal here. I want to do further processing of the "subtotal" data (basically, I want to sort the list on the subtotalled sum values) and I would like to know if there is any method to delete all rows except the "subtotal" rows from the sheet other than the method described here, in another post in 2003.
Copy subtotals only - visible cells too complicated [SOLVED]
This works fine but I have the word Total in some of the columns I am sub-totalling.
Also, some of the entries in that column are very long strings to start with and when the subtotal is made by Excel, the details are truncated (probably to 255 characdters) and the word Total is not there.
I would like to insert rows below each of the subtotals in column D and F in the attached sheet. The current code I am using can only add rows according to one column. I don't know how to modify it so that it works on both columns. Also, when rows are added according to column D, the new inserted rows are filled with colors and I don't know how to remove. Lastly, how can I run this marco in multiple sheets?
Sub InsertRows()
Dim i As Integer
Dim rRw As Range
Set rRw = Range("D1")
For i = 1 To WorksheetFunction.CountIf(Columns(4), "* Total")
Set rRw = Columns(4). Find(What:="* Total", After:=rRw.Offset(2, 0), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
If rRw.Value <> "Grand Total" Then
rRw.Offset(1, 0).EntireRow.Insert
End If
Next i
Set rRw = Nothing
End Sub
vb code that will break out each 6 digit media used in their own rows such as in the illustration below.
Sample data before macro
Master Backup
GTI - Hostname
[Code]....
a huge spreadsheet that is taking up way too much time. It starts out with 6,000-7,000 rows, but then, she does Subtotals & it grows to nearly 10,000 rows! Then she has to deal with each & every one of the Subtotal rows, by hand. Here is a small sample of the spreadsheet, after the Subtotals have been applied:
Manifest Dttm
Manifest No
Carrier Scac
[Code].....
This sheet has columns A-Q. The key columns for our purposes are K (Weight In Lbs), L (Pickup Charge) and M (Consolidation Charge). We need to add information to column R on each SUBTOTAL row only! On each row there will be an amount in EITHER column L or column M, but not both.
1) If the amount is in L and K is LESS than 488 then R needs to show 44.39.
2) If the amount is in M and K is LESS than 124 then R needs to show 3.82.
3) If either
a. The amount is in L and K is 488 or HIGHER or -
b. The amount is in M and K is 124 or HIGHER
THEN R needs to show a formula to do this: (L+M)/(K/100)
Is there a way to either put a formula in just the Subtotal rows to accomplish this or (preferably) have a macro enter either the 44.39, 3.82 or the formula? I was able to come up with a formula that gets the correct amount in col R. Here's my formula:
Code:
=IF(AND(M3=0,K3123))),SUM(L3:M3)/(K3/100))))))
Any VBA code to delete rows in a subtotalled list?
The subtotal line and the associated rows should be deleted when subtotal equals zero.
I have a large spreadsheet with 25 columns.
I need a macro to delete prior rows if SUBTOTAL in column K equal zero.
Below is a series of sets. Column A is the set number. I need a macro that will insert a row between sets and then put a border around each set. In my spreadsheet the sets are from A1:C500. Sometimes the sets are only 1 row, sometimes multiple rows. It looks like I will be doing one of these sheets every week. So far I have been doing it manually, but a macro sure would save some time.
View 13 Replies View RelatedI posted a thread a while back about how to ignore hidden rows from autofilter when using formulas. http://www.excelforum.com/excel-work...ml#post2039071
The solution worked perfectly. But I have since had to use this on another sheet which is laid out a bit differently, I have tried everything to try and modify the formula to work on the new sheet but so far I have failed miserably!! I need to do the exact same thing on this sheet - filter the sheet by week and search the data for certain criteria ('Line' and 'Fail Reason') and sum up the total quantity, while ignoring autofilters hidden rows. Here is an example of the sheet, along with an attempt of mine to modify the formula, which I think I have got TOTALLY wrong!
Import Financial System -Recaps Trial BalanceFrom Date:31-Jul-2011,To Date:27-Aug-2011,
Requested By:Jenny Drumm,30-Aug-2011 9:28 AMAge Range: 0 - 30, No. of recaps: 231
Broker File NumberAgeVendor/Co/DeptFirstBankAssistsFRTBRODTYLoadsInvInvClaimsGL AcctTRUETRUEBalanceCostFeeRecptsAdjRecptsROE VarLC Var
[Code] ........
There are more age groups, & some groups have hundreds of lines. Each of the total line in the report has a number plugged in by the system, which, because of rounding, may be off by several cents. I figured out how to move the rows with Broker File Numer, etc & the row after it up above the first Age Range.
What I need to do next is:Delete all rows between "Age Range: ....." and the start of that range's data.Delete all blank rows between "Totals" and the next "Age Range: ...."Delete 5 rows after "Grand Total"Put a formula in the row immediately above each age range's "Totals" for each column, summing all the data for that column, in that age range. (Hopefully with the word Total in column B of that row, too)Put a formula in the row immediately above the "Totals" after "Grand Total" that adds together each of the Age Range totals.(I did figure out how to get the "Balance" cell in each row to sum that row going right to left, so at least I got a start! For that I'm using
Code:
LR = Range("C" & Rows.count).End(xlUp).Row
With Range("R10:R" & LR)
.NumberFormat = "#,##0.00_);[Red](#,##0.00)"
.HorizontalAlignment = xlRight
.VerticalAlignment = xlTop
.FormulaR1C1 = "=IF(ISNUMBER(RC3), Sum(RC5:RC17), " & Chr(34) & Chr(34) & ")"
End With
writing a VBA to convert a set of data in sheet 1 to one in sheet 2(I am enclosing that as a Excel document"Test -Original").I have described what needs to be done ( step by step ) below.
Develop a macro
1. I have a report from SAP BW, the original format of which is in sheet 1.I need to develop a macro using VBA and need the report with the format in sheet 2.
2. I need a “Results “row after every Bill to Party in column A as below(screen shot 1.doc):
The number of customers is dynamic i.e.it keeps changing every month
4. Nothing needs to be done to column.SAP BW will not overwrite the format and the data in column G.Hence leave it as it is.
5. Calculate the number of Sales document numbers for each customer and put the value of 1 for every value. If it is blank it should not be counted and put the value of 0 for those rows. (Shown below) Display the sum of the number of sales document numbers in the results row for column H
6. In the column I, put the value of 1 if the difference column (column G) is 0 and put the value of 0 if the value in the difference column (column G) is any value apart from 0.now sum the value in the results row for each customer and display the summation value in the results row under column I
7. Compute the percentage which is the values in (column I/Column J)*100 .This should be done only for the results row
way to do this but i have a sheet that is into 5 - 6 thous rows, in one of the columns (names) i sort it by names and then order it by subtotal for certain values.
What i need to know, is there anyway i can take just the subtotal values out and put onto another spreadsheet without copying and pasting it all as there are lots of subtotals and this would help alot as the other info is not nec. just the subtotal'd info. either that or is there anyway i can highlight the subtotal'd row info in yellow/bold text anything like that that would make it stand out without having to do it manually?
I’m trying to get my sheet so that at each change in month it creates a sum of the value but I want to sum to show up in the subtotal value column.....
View 10 Replies View RelatedI have two sets of data for students. One set contains all the students with certain test scores, taking up columns A to N. The other set contains about 80% of those same students with a different set of test scores. Students are sorted by ID numbers. How do I combine the second set into columns O to V so that student ID numbers match and it inputs the rest of the student data into the sheet.
I know there will be some blanks because not all students will be there but I need them to match up, even with the blanks.
I created a macro that extracts two columns of numbers from one workbook and need to match them to another set of numbers in another workbook. For instance i have numbers like...
18314 907
18272 64
11005 907
11005 324
..Now i need to match these numbers up with the others to find the hyperlink associated with them.
I am trying to merge my boss's contacts. He has one enormous set of contacts in GMail (5000+) and one enormous set of contacts in Excel (5000+) I've exported both sets into excel but how to I merge them?
The headers for each set are in a slightly different order (Home Address, Office Address, Email ...vs.....Office Address, Home Address, Email) Do I need to make sure the order of the headers match in both the GMail Sheet and the Outlook Sheet and is there a faster way to do that than just rearranging them manually?
My second question is how do I merge them? There are a lot of over-laps of people but some info might be different in Outlook than in GMail. For example I might have John Smith as a contact in both Gmail and Outlook but two different email addresses for him under the header "Email 1" how do I make sure one email doesn't eliminate the other? I just want to merge both sets of contact info for each person into one super contact.
I'm attempting to create a mailing list for the company I work for, but the software that has the data record is very limiting. The two tables I received from the program are listed:
Customer
Number of Sales
name 1
#
name 2
#
name 3
I tried to illustrate that the address list has a different customer composition than the sales list; the address list has customers that the sales list doesn't have. This means I can't just sort alphabetically and drag the addresses over. My goal here is to create a datasheet that incorporates both the address and number of sales so that we can send the top 500 customers a mailing. How can I do this?
I have 3 seperate tabs of data that i want to put into a combined sheet, how would i do this, i assume it's just like a copy/paste exercise but not sure how to do this using VBA?
My tab names are;
FND Data
UL Data
Life data
I just need the entire range copying from each tab into the 'Combined' tab
I have an requirement that retrieving the data from two different data bases. I want to compare those two and prepare a report using VBA. I am able to get the data to excel separately, but now I need to join these two sets based on the key columns
View 2 Replies View RelatedWe have customers who order items in a specific order (Product X first, Product Y second, Product Z, etc...)
As it stands, no one orders in the same way and we want to try to standardize this process.
I have a list of about 600 products, such as : Product XProduct YProduct ZProduct 300...
I need to know the top 10 products ordered together. (the idea is that this variable will be changeable, and I can see the top 11, 12, or even more)
My idea is to generate a list of arrays in a new sheet with 10 products in them from the list; ie {Product A, Product B, Product C...Product K}, (noting to alphabetize the array entries and then remove duplicates form the row)
With this list, I will use each entry to check with each customer if they're order set array equals this list (again, alphabitized and duplicates removed to ensure comparison).
My question:Is this the most optimal way to do this? ... I am not even sure it would get me where I want to be. As it seems like an amazing amount of coding and formulas; but through my searching I haven't found this unique example.How can I generate my unique, alphabetized arrays for comparison (ie: 10x10, 9x9, 8x8...)
In the attached workbook, I have identical sets of data in column A separated by an blank cells. I need a macro for user form that searches for an item indicated in the textbox of the form and then delete the whole row in all sets of data.
It is important to keep the blank cells between the sets constant, 4 blank cells between each set, except the first set that starts with 3 blank cells.
I have 1 original and 1 new IF statements, but need to combine into 1. Is this possible?
Here are my IF statements:
=IF(I15="WSP - DT",I29,IF(I29=0,IF(I30=0," ",+I29+I30+I39+IF(I25=0,0,(I25-1)*1900)),I29+I39+IF(I25=0,0,(I25-1)*1900)))
=IF(I13="Base Suite",IF(I15="Self Serve - Web",AK81),IF(I13="Base Suite + Key Account Advantage",IF(I15="Self Serve - Web", AK84),IF(I13="Key Account Advantage (Stand Alone)",IF(I15="Self Serve - Web", AK87))))
The names in " "s are set up in drop downs.
If a value fallw within these ranges, then the next cell should calculate the answer according to the percentages outlined.
for exmaple:
If somethng costs 250.00 then the next cell should display - 250 x .50 and the answer would be 375.00
1-500 = 50%
501-1500 = 45%
1501 - 1600 = 40%
1601 - 2500 = 35%
2501+ = 30%
and automatically calculate the answer.
I know there's an IF formula, but I can't seem to figure out how to do multiple IF's ~
I am attaching a worksheet for which I need to calculate "National Points". I need to select 5 lowest values from "Tech" and "Speed" (Row 3 headings) events to the left of the totals column but a minimum of three "Tech" values need to be used. I have used the min, small 2, small 3 for the "Tech" set then used an IF statement for the fourth value. The formula returns the correct sum for values up to the fourth value. The problem comes on the fifth value. It seems to depend on if the 4th and 5th value come from the "Tech" events or "Speed" events. I have calculated the values manually and am unable to get them to correspond all the time. Can anyone help?
View 9 Replies View RelatedI’m trying to get the total number of participants in two different sets, with selection criteria attached to both (I’ve attached an excel file, as the example with those scoring +ve highlighted in yellow). The first set A (b1:b15) I want to select all values above 5, and the second B (c1:c15) set above 10. There other provisor, is that the A and B are further split into two groups (one above and one below 20).
In summary, I need to count all the A>5, B>10 (And both have to be above 20 in column D), but not to double count the ones that have Both A>5 and B>10. I don’t want any duplicates to be counted, so summing the total of A and adding it to B won’t work. In essence it’s an attempt to use the A Union B function that you’d observe when using venn diagrams.
Is there a simple way/formula of doing this?