I have a spreadsheet with a couple hundred rows, and some of the cells contain the text "N/A". I'd like to delete the full row of any cell that has "N/A" in it.
My first thought was to use Find All and then once all the relevant cells are selected, I can do Ctrl - and select "entire rows". However this usually leaves a bunch of cells with "N/A". Why is this?
Insert a column (or use last available blank column).
Use equation IFERROR(SEARCH("N/A", A2),"No Match") where I am
assuming Column A has your strings that may contain N/A
Drop Equation down to used range
Filter your new helper column and remove No Match
Delete rows of visible cells
Output below. Any numeric value in Column B means a match of N/A was found.
Related
In column C, there are duplicate values that I don't want. How do I go about filtering the rows by the condition - Show the rows where there are duplicate values in column C?
I would add a helper column at the end with =COUNTIF(C:C;C1) and copy it down behind every row with data. Then filter on >1.
Or you can create a pivottable and put column C in the values as a count.
Easiest way is to add conditional formatting for duplicates and then filter on colour - it doesn't involve changing your data set at all and is an easy visual cue as to where duplicates exist. However, similar to the answer above, this will filter out both the original and the duplicate record.
If you want one of the rows to show (i.e. 1 of each value in column C), then a new column with the COUNTIF formula applied to the range starting 1 cell below or above would work. So if the new column was "D", in cell "D2", you would use either;
Cell above:
= COUNTIF($C$1:$C1,$C2)
OR
Cell below:
= COUNTIF($C3:$C$9000,$C2)
Note: if you use the count from the cell below (i.e. to show the last row where that value is found), you will need to assign a "finish row" - I used 9000, but you could go to 1048576 if you want to include whole sheet.
You would then filter column D to only show 0s
These solutions assume you still want to keep the records, just hide them. If this is not the case, there are easy ways to delete duplicates.
I am looking to select every third blank row in excel. Once I do that, I need to enter a formula into this third blank row that extracts the contents of a cell below. I would like to have it so this will be done for every third blank. A macro would be fine, I am just not familiar with VBA code so I am not sure where to start.
You'll notice that every third blank row contains the ID from column a in the row below it, and the name from column g below the third blank. Any ideas of how this can be done efficiently?
Just add a column which repeats every 3 rows and filter on that!
You may also be looking for Pivot Tables
Add two columns before column "A", so that your id column becomes column "C".
Now fill all cells with value 1 till the last of your data range in column "A".
In cell "B1" use below formula & fill down till your data
=ISNUMBER(D1)
Now add filter ( Ctrl + Shift + L ). And filter data in column "B" with "FALSE"
If you can follow these steps exactly, you will get all rows you want.
Then use this formula in Than apply filter.
I have two columns of values in excel I want to format.
If two Rows in Column A match, check column B to see if those two row's values match also. If they don't match, highlight the rows.
For example, the first columns first two rows values match so I want to check the second column to see if they match. They do not so both rows should be highlighted. The third and fourth match, and the second column for those rows also match, so these should not be highlighted.
Number Tool
227974 9285
227974 9219
229703 9219
229703 9219
Assuming your data is in the top left, select the data cells and create a conditional format with condition:
=OR(AND($A2=$A3,$B2<>$B3),AND($A1=$A2,$B1<>$B2))
And set it to highlight as you would like.
I have 834,000+ rows of data in columns A-S. There are pairs of rows separated by a blank row. For each pair, I need to compare column S in both rows and if they both contain "Y", then I need both rows highlighted. If they don't match, then no action is taken. How can I set this up so that it skips the blank rows and highlights the pairs correctly?
Try this formula in cell T10 : =AND(S10="Y",OR(S10=S9,S10=S11)) then copy it up and down. If that shows TRUE for the rows you want to highlight .. you can now easily setup a conditional format for the range, based on Column T. ;)
I have a table with student IDs separated in groups. I need a handy way to count the total number of students in each group and populate it after the last row of each group (marked with ??)
Currently I just enter =COUNT() and then manually figure out the top and bottom borders of the range for each group. Not convenient at all.
I was thinking that a possible solution could be one of the following:
A some kind of pivot table permutation. I failed on this one.
Excel Data->Outline->Subtotals functions. Again, fail. It keeps creating new rows in my table.
A universal formula that can be pasted into each ?? cell. Not the most graceful solution, but still would do.
A macro. As a last remedy if nothing else works.
The following steps will calculate the subtotals while preserving the structuring and formatting of your worksheet.
Put this formula in cell C1 and copy the formula down the column:
=IF(NOT(ISERROR(SEARCH("Total",A1))),COUNTA(INDIRECT("B"&MATCH(LEFT(A1,LEN(A1)-7),A:A,0)+1&".B"&(MATCH(A1,A:A,0)+1))),IF(B1="","",B1))
Apply a conditional format to cell C1 with the formula rule =(MOD(ROW(C1),2)=0) and blue fill to match the shading on the other rows. Copy the format down the column using Paste Special Format.
Either hide column B, or copy the values in column C to column B using Paste Special Values and hide Column C. If you decide to copy the values to column B, you won't need to set the conditional formats.
Here is what the formula does:
First, check whether the formula's row is a Total row, by searching the cell in column A of the row for the word "Total," using the SEARCH function.
If the word "Total" is found:
Determine the range in the worksheet of the student IDs for the group for that total row:
a) Identify the rows in which the words "GroupX" and "GroupX Total" are found by using the MATCH function. With that, you know that the IDs for the group are in a range that starts at, say, row x and ends at row y.
b) With the starting and ending row numbers, construct the address range in which the IDs lie, which has to be the string "B" + (row x) + "." + "B" + (row y).
c) Turn the string into a range reference that can actually used in a formula using the INDIRECT function.
Count the number of students in the group using the COUNTA function and the range, and show that as the formula's result.
If the word "Total" is not found
Check whether the cell in column B is empty
a) If it is empty, show a blank as the formula's result
b) if it is not empty, it must be a student ID, so show the ID as the formula's result.
Add a column (I usually add it to the LEFT of the existing matrix) where you enter a formula from row 2 onwards that fills the blanks in the old column A. Then the old matrix including your new column can be used in a pivot.
So Insert a column left of your matrix, this is column A now. Put a header in Cell A1, for example "Group Name1"
Enter the following formula in cell B2 and extend it to the end:
=IF(B2="",A1,B2) This way your blanks will be filled.
Now apply a pivot on this matrix and there you are.
Maybe not the nicest looking solution, but its quick and works well.
If u have table like this
Students id Name of students group ........
then u can use countif/countifs formula