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. ;)
Related
I want to define a dynamic range that will expand the rows and columns of my range whenever a new row or column is inserted. My current formula does not want to expand to cell $T$13. My headers start in row $M$7. How can I adjust my formula?
Formula Being Used
=OFFSET(Sheet1!$M$8,0,0,COUNTA(Sheet1!$M:$M),COUNTA(Sheet1!$1:$1))
I need my range to expand to cell $T$13
Right now, your formula counts the number of text values in column M.
That is not a robust approach because column M contains only five text values, but columns S and T have many more values.
If you don't know which column may have the most number of entries, you can introduce a helper cell in each column that counts the number of entries below. I suggest you insert a new row 2. In column M, for example, put a formula in M2
=counta($M$3:M$99999)
Copy that formula across to column T.
Next you can evaluate which of the columns has the largest number
=max(M2:T2)
This can be plugged into your original formula like this:
=OFFSET(Sheet1!$M$8,0,0,max(M2:T2),COUNTA(Sheet1!$1:$1))
So now, instead of just looking at how many rows are in column M, the formula uses the maximum number of rows in the columns M to S.
You can now hide row 2 if it upsets your worksheet design.
Edit: the mere count of text values with CountA will ignore blank cells and will return incorrect results. You really need a formula to find the row number of the last populated cell in each column.
This should really be a new question, but here goes
If the column has number values you can use
=MATCH(99^99,B5:B999,1)
If the column has text values you can use
=MATCH("zzz",C5:C999,1)
Adjust your ranges accordingly.
I ended up using the solution mentioned by #tevlyn.
In range$M2:$T2
I have the follolwing formula =IFERROR(MATCH(99^99,M$8:M$999,1),0).
I've added IFERROR because my data doesn't always have data stretched to $T2.
I then defined my range in name manager using:
=OFFSET(Sheet3!$M$8,0,0,MAX(Sheet3!$M$2:$T$2),COUNTA(Sheet3!$1:$1))
This still works even if there are blanks in between the range.
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.
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 a table with times of actions and I want to highlight rows that are more than 20-ish minutes more than the one above.
The actual number of minutes is less important.
For that I use conditional formatting with the formula:
=F3-F2>0,01766
So far so good.
But now if I apply filter on the table the the formula does not work anymore because it looks at the hidden rows.
Only the first highlight is made by the conditional formatting the other two are done by me.
Is it possible to get conditional formatting to look at the visible rows only?
I was able to come up with a solution only by using a special columns for the filtered index. In my example, i am filtering the data by '1', So i will add '1' in Column L. If you have multiple filters, you can add in the next rows in col L.
Col H checks if cell in Col E exists in the filters list
Col I finds the last row that is not filtered. The formula has to be entered as an Array Formula i.e. enter the formula and press Ctrl Shift Enter
Col J checks if the difference between cells in Col F for the current row and the last not filtered row is between 20 and 21 minutes. Conditional formatting is applied for this cell being true
Below image without applying any filter
After adding '1' as filter
Filtered rows hidden
Formula
Here is a Google Sheet
Note that SUBTOTAL() has options for ignoring hidden rows: this gives you a way to create a formula-based helper column for determining whether or not a row is filtered out....
Note Col C is an Array formula
After filtering for "A" only:
This way you can filter on multiple columns if required.
Put simply, I need to sort row data for a specific range into the correct columns based on that columns heading. For example, if there are five columns labelled A through E, and data in the rows below ranging from A through E; I need all of the A's to be in the A column, all of the B's in the B column etc.
Example start data:
How it should look after the sort:
It also must be able to work with the possibility of having empty cells. For example; if the first example data had no B in row 3, the data must not shift over to the left so that C is in the B column etc.
Other info: not feasible to do by hand - over 450 rows.
It also must be able to work with the possibility of having empty cells.
Taking the above into consideration.
NON VBA WAY
Insert enough columns so that the data moves to the right
Next in the row one, duplicate the values from your data
Next in Cell A2 Put this formula
=IF(COUNTIF($H$2:$L$2,A1)>0,A1,"")
Copy the formula to the right
Next remove "$" from the table range and add it to the header in formula in Cell A2 so that we can copy the formula down. This is how it would look
=IF(COUNTIF(H2:L2,$A$1)>0,$A$1,"")
Similarly your B2 formula will look like this
=IF(COUNTIF(H2:L2,$B$1)>0,$B$1,"")
Change it for the rest
How highlight cells A2:E2 and copy the formula down.
Your final Sorted Data looks like this.
Copy columns A:E and do a paste special values on Col A:E itself so that the formulas change into values and then delete Cols H:L