Setting Criteria For Rows In Pivotttable
May 30, 2007
The attachment contains a small extract from a database, and an associated PivotTable. In the database certain cells contain 1 and are coloured, others contain 0 and their font colour is white. In the original these cells all contain formulae. I want my PivotTable to pick up only cells with a 1 (or more). So, in the example, only nine of the rows are useful and I don't want the other six. The rows I want of course depend on the year I select.
View 2 Replies
ADVERTISEMENT
Apr 27, 2009
i would like to set a criteria bewteen a ranges. eg If A1 >0 but <100 then .3, Else If A1 >99 but <200 then .6, Else .9. How do i write this in the cell?
View 4 Replies
View Related
Feb 15, 2012
I'm trying to delete a column based on a simple criteria. If the column contains no data it has to be deleted, but I really couldn't do it.
Code:
With Sheets("Test")
Columns("AH:AH").Select
If Columns("AH:AH") = "" Then
Selection.Delete Shift:=xlToLeft
Else
Exit Sub
End If
View 6 Replies
View Related
Feb 17, 2014
A B
17-Feb 5.00
19-Feb 12.00
22-Feb 7.00
26-Feb 10.00
I would like to see the sum of B given it is in the range from 17-Feb to 23-Feb. My estimations so far:
=sumif(A:A,????, B:B)
How do I set up a criteria which would take values from 17-Feb to 23-Feb?
I also tried =sum(sumif(A:A,{17-Feb;?;?;23-feb}, B:B) but it wouldn't let me.
Particularly the problem is in entering the date in the array.
View 1 Replies
View Related
Oct 6, 2007
I generated my spreadsheet in using vb6.
Everything is working except that when I display the display (making it visible), some of the data in the rows hides underneath the row lines. I have to physically go into the spreadsheet to expand the rows to see the hidden data. Also, if I print the spreadsheet, the hidden part of the spreadsheet is cut off unless I mannually expand the rows. How can I programmatically expand the rows to fit each amount of records in the row. Currently, I have a module that is mannually calculating the rows
Also, I have attached the spreadsheet so that you can see my output.
Below is the code that calculates and formats the row presently:
w = 0
For Each R In xlWksht. Range("A5:N5"): w = w + R.ColumnWidth: Next
rht = xlWksht.Range("A5").RowHeight
With xlWksht.Range(xlWksht.Cells(ii + 1, 2), xlWksht.Cells(ii + 1, 14))
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.MergeCells = True
.RowHeight = .Font.Size * (Len(xlWksht.Range("A" & ii + 2).text) - Len("Comments:")) / w + rht + (rht - .Font.Size) ' + newlinecnt * .Font.Size
End With
Below is my entire module:
ii = 5
w = 0
For Each R In xlWksht.Range("A5:N5"): w = w + R.ColumnWidth: Next
rht = xlWksht.Range("A5").RowHeight
'Do Until M.qBW.EOF = True
Do While Not M.qBW.EOF
ii = ii + 2
xlWksht.Cells(ii, 1).Value = M.qBW![Req No]
xlWksht.Cells(ii, 2).Value = M.qBW![Description]
xlWksht.Cells(ii, 3).Value = ""
xlWksht.Cells(ii, 4).Value = M.qBW![ClientName] & Chr(10) & M.qBW![Status]
xlWksht.Cells(ii, 5).Value = M.qBW![P L] & Chr(10) & M.qBW![TotalProg1Hrs] ...
View 5 Replies
View Related
Dec 6, 2013
I have a table with 3 columns with an unkown number of rows (text, date, date) that is being imported daily.
I want to create a 4th column with dates starting from today and each subsequent row be one day earlier. I want to look at 30 previous days.
I then want to count the number of rows (looking at column 1-3) with the following criteria:
Countif column2<= "date in colum4" AND column3< "date in column4"
View 6 Replies
View Related
Sep 22, 2009
Here is what I have. 4 Worksheets. The first worksheet is a summary page. I have 350 personnel that are broken down into three different groups. So each group has it's own sheet. Here is what I need to accomplish. Results need to be posted on the summary sheet.
I need to compare cells B2 & D3 for each row on a worksheet and display the number of times they match on a worksheet. For example how many times does EP & EP match on a certain row. I need to compare cells B2 & D3 for each row on a worksheeet and display the number of times they don't match on a worksheet. For example how many times does EP & MP occur. I've attached an example for reference
View 5 Replies
View Related
Jul 11, 2007
my excel setting... I'm not able to see some of the numbers (in currency/accounting) in excel file, it shows as many "#" sign, and it's not due to the column width. The same file can be seen in other computer.
The format setting is the same in all the cells but only certain rows/cells' numbers appear like "normal".
View 9 Replies
View Related
Aug 28, 2007
I have a worksheet in which I have sorted the data based in date and numbering (column I and E). I would like to create 2 macros for following actions:
1- all rows with the value "TOM" in column C will have to be deleted.
2- all rows with a value of 601 or 602 in column E, will have to be moved to the bottom of the sheet after the last row with data. The rows that have been moved will have to be sorted based in date (column I) and numbering (column E).
View 2 Replies
View Related
Mar 5, 2008
This sheet has A:K columns and 1:3212 rows. There are 'page headers' that are in the text file that I want to delete (the text file was exported from an AS400 program). The first row that starts the page header has SA341 in column 1. Each page header has 5 rows. I used this code from one of the other threads on deleting rows, but I obviously do not understand the code as it deleted all rows that contained SA341.
Sub DeleteRows()
Column_To_Check = 1
Start_Row = 1
End_Row = ActiveSheet. Cells(Rows.Count, Column_To_Check).End(xlUp).Row
MsgBox End_Row
Search_String = "SA341"
For Row_Counter = End_Row To Start_Row Step -1
If ActiveSheet.Cells(Row_Counter, Column_To_Check).Value < SA341 > Search_String Then
ActiveSheet.Rows(Row_Counter).Delete
End If
Next Row_Counter
End Sub
View 9 Replies
View Related
Apr 30, 2014
I worked on a countifs function, but i needed a average of column N.
the countif formula is
A2 = current month
=COUNTIFS(
'Location'!J3:J999,">="&$A2,
'Location!J3:J999,"<="&EOMONTH($A2,0),
'Location'!M3:M999,"Name")
With the exceptions from above i need to get a average from column N.
View 4 Replies
View Related
Feb 1, 2009
Relatively new to advanced Excel and have browsed a bit but haven't found anything to help me. If a thread exists that answers my question, please link!
Short version: What I'd like is for Excel to know to add the value of G to the value of D of the previous row that has the same F value.
I have a spreadsheet that has financial data from three bank accounts, H, S and P. Columns in order are Date, Transaction, Category, Amount, Acct_Bal [for account balance], Acct [H, S or P], Acct_Avail [for available funds] and T_Avail [for sum of available funds of all three accounts].
At the moment, I am manually creating formulae in G (Acct_Avail). For instance, row 17 is the S account, and G17's formula is =SUM($G$9,D17), giving the account balance for S account after transaction D17, given the previous balance in G9, when that account was last used. I'm sure there's a better way, but this is beyond my ability.
View 11 Replies
View Related
Jul 31, 2014
delete rows if two conditions are met .THe sample data looks as shown below:
I need to check for a given resource where the allocation hours are highest against which project , and then delete the rest of the rows for that resource records.If the Allocation hours are the same , then the priority column should be considered the highest priority should be included and the rest to be deleted.And if the priority is also the same then need just one record to remain rest of the rows to be deleted.I have priority of business area ranging from
Resource NameResource IDProject NameBusiness areapriorityAllocation hours
Lavanya 123243 MarketingSales 145
Lavanya 123243 Sales Sales 1150
Mukund 5678 Re engineeringRetail 210
Mukund 5678 StreamliningGeneric 990
Mukund 5678 documnentationDocumentation 850
View 5 Replies
View Related
Oct 3, 2013
I have rows like below in Column A. I wish to cycle till row 700 and delete rows where Right(A2(,1)="X") and also Rows where there is a blank Cell.
5
22X3
65
260X
70X5
8X66
873X
2206
059X
088X
90X8
2283
7606
View 6 Replies
View Related
Jan 19, 2014
There are two workseets involved. Inventory is the main and Pending is the second. There are 28 columns of data in each that match based on row 1 headers. I need to figure out how to cut all the rows with "Pend" listed in Inventory column Z to one row below the data in column A of the Pending worksheet. The data can be dates and also notes but no matter what is in column Z it must be cut and moved.
View 6 Replies
View Related
Jul 20, 2009
I have the following table, which starts in Column A, row 2. I would like to have a macro, that deletes some rows after certain criteria.
If Column F = SO normal and
Column E = aa, bb, cc, dd, ee, ff then delete the whole row.
GeoRgn refSub Rgn refCountry Country 2GroupENNR3NxaaSO claim-inENNR3NxbbSO claim-inENNR3Nx222SO claim-inENNR3Nx222SO claim-inENNR3Nx222SO claim-inENNR3Nx222SO claim-inENNR3NxaaSO normalENNR3NxbbSO normalENNR3NxccSO normalENNR3NxddSO normalENNR3NxeeSO normalENNR3NxffSO normalENNR3Nx111SO normalENNR3Nx111SO normalENNR3Nx111SO normalENNR3Nx222SO normal
View 9 Replies
View Related
Oct 23, 2009
I've got a file set up like this:
1001 Value 1
Value 2
Value 3
1018 Value 1
Value 2
1023 Value 1
Value 2
Value 3
Value 4
1029 Value 1
Value 2
Etc.
Now I want to delete the sections where the 1000-something value ends on 3/4/7/8 and keep the sections where the 1000-something value ends on 1/2/5/6/9/0 So the result would look like this: ....
View 9 Replies
View Related
May 12, 2007
I am trying to set formula to change row colour when certain criterias are met the options must be availiable for all rows but Governed of one colum.
Eg. If Cell A1 = "Contacted" then row will change to colour Green,
"Left message then row will change to amber
"Not contacted" then row will change to Red
"Do not contact" then row will change blue
If these can be set as drop down menu to save operator typing them that's even better.
Once one is set I can copy the formula into the remaining collums.
View 9 Replies
View Related
Nov 20, 2007
i need a macro for inserting a row in sheet by criteria. the Criteria:
1-checking if Collumn G ( letters ) are equal
if not then inserting the row
2-cheking if collumn H ( numbers ) are equal
if not then inserting the row
one more thing i need the row to be yellow from collumn B .. to .. I
View 4 Replies
View Related
Dec 9, 2007
I have an excel 2007 file, which is quite big: ~10mb. There are situated plenty of columns with coordinates. I would like to transcribe it, modify those data, but it will take me ages. I'm not acquainted with macros, but I heard that people can do with them everything using computers' abilities. I'll abridge my whole problem.
I give you a sample of that file, so please open it. In the file you can see two 'columns'. Every column has two other columns called x and y. As you are thinking now these two columns are containing arguments (in x column) and their values (in column y). Every third column is empty. In attached file you see, that arguments are repeating and values are increasing by one. Sometimes there is an argument without repeats, and sometimes there are only two repeating arguments.
What I wanted to do is delete those repeating arguments leaving arguments with the highest and the lowest value. Example: Please look at range A230:B232. There are three repeating arguments and for this case I should delete row 231 from columns A&B and then move cells up to join separated columns. There are also not repeating arguments, which I need to double. If there will be only two repeating arguments I would like leave them. In the end I should have a clear view for all those coordinates.
View 8 Replies
View Related
Feb 13, 2014
Check the file for reference.
Basically, I want to conditional format(fill entire column with a color) if the numbers of non-empty cells for any given column are more than 2 for each team (labeled Alpha, Delta, Office, etc). So what I want to do is to count how many rows contain a letter (V or P) in a team (in column A) and if it exceeds 2, I can conditional format the entire column. I believe I know how to conditional format. I just need to get the counting function going.
Example.xlsx
View 2 Replies
View Related
Sep 8, 2009
i have several student ID results that have conditional formatting in place. I'd like to KEEP the following data but delete/hide everything else:
1) Filter out purple rows
2) WITH filtered rows: KEEP any scoreA that's 100% or less than 85%
3) Look at Score A and Score B - KEEP if the difference is greater/less than 5%
4) If a student took testB but didnt take testA, KEEP.
View 2 Replies
View Related
Dec 15, 2012
I am looking for a macro to delete rows that DO NOT contain criteria. But what I could achieve so far is deleting all rows except the first word ie ACC here. My code so far is as follows
[Code] ..........
View 12 Replies
View Related
Jan 30, 2013
I have a column with dates (dd.mm.yy) and I have a column with names. Moreover, several dates and names are repeated. What is needed, is to delete all the rows in which the difference between dates is smaller than 1825 days (5years) for the same name. (Namely, if I have three rows 01.01.1996 - "A"; 01.01.2002 - "A" ; 01.01.2005 - "A" I want all the rows with "A" to be deleted)
View 5 Replies
View Related
Feb 2, 2009
I would like a macro that scrolls through each row and deletes it if it contains the word "Account" in column B.
View 5 Replies
View Related
Feb 14, 2009
I simply want to delete the last 10 rows containing date from a worksheet. No criteria other than they contain data anywhere in the row.
View 4 Replies
View Related
Sep 24, 2009
I have a sheet with say 1000+ rows that is a QA report of possible mistakes found in a employee rostering tool.
The report finds all occurrences where the staff member only has one coffee break rather than the two they are entitled to. However, on days where they have training, or other half day commitments, on of the coffee breaks is not entered into out tool. This means we are getting a whole lot of entries that we do not require(i.e. one coffee break error).
The tool uses icons but the cells do have a single unique character under each icon type. For example, the coffee break cells have a "T" and training cells have a "&" underneath the icon (without quotes). The staff members day is separated into 15 minute blocks and each block occupies a cell in a column. This means each staff members day spans many columns in a row (i.e. C=8am, D=8:15am, E=8:30am etc...).
What I have been trying to accomplish is to create a macro in VB code that will locate any row with both a "T and a "&" and delete it. This will eliminate occurrences that we are aware of and leave only genuine errors. There are other combination's that I would like to include also such as:
"T" "["
"T" "#"
"T" "@"
"T" "]"
The first row is headers and the first two columns contain team names and staff names which I am trying to exclude (because names contains "T"'s ).
I have spent many hours now looking for example code on Google, this forum and other forums, however most of the examples I have found are looking for two criteria within a column or specific criteria that is not suitable to my application (i.e. values <> certain numbers etc...).
View 8 Replies
View Related
Oct 6, 2009
What am I doing wrong here?
I have a code and it doesn't error out, but it won't hide the rows either. I'm pretty sure the red is what needs to be altered. I've tried adding "Selection.", "Rows." and "Cells." and none of them are working.
View 12 Replies
View Related
Jan 23, 2010
I had a raw data sheet in which i need to prepare a statement just like the attached worksheet.
My requirement is to delete all those rows in the department column except the department which starts with "C" Just like "CNN" & "CNN-IN".
Rows with data containing the words starting with "CNN" should not be deleted .The rows can contain words with "CNN" or "CNN*"(here * denotes anything after the word CNN)
I had just formatted the whole worksheet for easy reference.Actually the raw data is extracted from other program which is very clumsy & irregular.
The department column might be in any column.
View 14 Replies
View Related
Oct 28, 2008
I've got two worksheets. One contains data from a query, the other worksheet should count rows in the queryresults based on two criteria. See example.
I tried doing it with sumproduct in the normal variant and the array-variant...
View 8 Replies
View Related