I'm trying to create a rule that formats a row so that it has red background color if the content of another row is "x". Unfortunately, the header and empty cells above the table will be included if I simply select =$H:$H="x" as my condition for formatting. I want something like: =$H$6:$H$(INFINITY). Is this possible?
If you want to apply the conditional formatting starting from Row6, while selecting the range for applying the conditional formatting, make sure C6 should be the first cell in the selection i.e. it should be the active cell in the selection and then make a new rule for conditional formatting using the formula given below.
=$H6="x"
Also if you are not sure how far you need to apply this conditional formatting down the rows, would be better if you format your data as an Excel Table, so when the data grows withing the table down the rows, the conditional formatting will also be carried to the new rows added in the table.
Having a conditional formatting for a unused range on the sheet increases the file size as all the rows contain the conditional formatting and the formula in the background.
You can just use =$H$6:$H$1048576 or =$H$6:$H$65536 while applying conditional formatting. A simplest way of doing this.
Your formula does lag a lot as you are searching through so many rows down. THe best thing you can do is try to limit the amount of rows to search. I.e. if you know your dataset only contains max 5000 rows, set the limit to that H6:H5000. This will help.
If the rows change a lot, the best way would be to make it dynamic. I.e. make a name range for the range you want to validate and in the name manager, change the range to include offset. This will help you set the range to be what you have data in. Note: You need to know how many rows (i.e. use counta) which you will need to figure out if there are blanks at any point. Otherwise you do the counta on a column where you have no blanks.
Hope this makes sense and easy for you.
Related
I'd like to change background color of cells if the value of $E2=$F1 (comparing different row and column). The range I have selected is =$E:$F.
I want the background color changed in both same value cells or at least on the first column cell. The problem is that I don't know of to tell excel to change the "1st. column, 2nd. row" of every comparison. Excel is changing only the cells of the first row and not the cells that have the same value.
Excel Sheet
Formula
I don't speak English, I hope you can understand what I am saying. :-)
Thank you!!!
Create a custom formula rule as =$E1=$F1, and apply it to the range =$E:$F.
Be careful that this will see two blank cells as equals and turn them red, so you're better off doing =$E3=$F3 applied to the range =$E3:$F12.
EDIT
Now I understand your question, just create two different rules,
=$E4=$F3 applied to range =$E4:$E12
=$E4=$F3 applied to range =$F3:$F12
I am currently trying to apply conditional formatting to certain rows which contain numbers in percentage (e.g. F11 to N11; F14 to N14; F17 to N17 and so on). These are also the only rows in the worksheet that have numbers in percentage. Would like to know what the fastest way to go about doing this is.
Should I:
(i) apply conditional formatting to the whole worksheet to numbers in percentage (if possible) or
(ii) apply conditional formatting to each individual row which is extremely time-consuming?
Appreciate if anyone can help.
Thanks in advance! :)
If your data in the percentage rows is also formatted as percentage, you can use the =CELL("format",[reference]) function, that returns "P0" or "P2" for percentage formatting.
Use a helper column (which you can hide if you want) to check the formatting of the first/last cell in the row, and then set conditional formatting based on the column:
After you create the column, you set a conditional formatting rule on the the upper-left cell in the range based on the formula: =[top cell in helper column]="P0". Keep the column fixed with a $ but not the row, as in the screenshot below, so you can drag the formatting to all the range with correct reference to the helper column.
Next step is to drag this cell to all the range, choosing the "formatting only" option:
Finally, you have to format again all rows that contains percentage values to percentage formatting.
However, if the place of the percentage rows is fixed, you don't need that CELL() function, just write in the helper column something like p or 1 for the rows to format.
(I have also tried to plug the formula directly to the formatting condition, but it doesn't work well all the time)
Tell me if it solved your problem ;)
I have a data validation set up for a list to choose from (B7:B1000), only two words can be selected: PP or SW. I have figured out a conditional format to fill the row if PP is selected but I need to apply this to the whole spreadsheet. I am having to apply conditional formatting for every row and it's time consuming if I need to do this for 1,000 rows.
I selected Use a formula to determine which cells to format. This is what I currently have it set up as:
=B7="PP" conditional formatting to be applied to =$F$7:$N$7
I now need to do this for all rows in the spreadsheet:
=B8="PP" conditional formatting to be applied to =$F$8:$N$8
=B9="PP" conditional formatting to be applied to =$F$9:$N$9
=B10="PP" conditional formatting to be applied to =$F$10:$N$10
and so on.
Is there a quicker way rather than manually doing this for 1,000 rows?
I have tried the format painter but its just copies the previous formula. Tried removing the $ symbols but when I click Apply they are re-inserted.
Your Title makes me wonder whether you would like some formatting for SW as well as PP but guessing you don't then in Row7 please try:
=$B7="PP"
for the CF formula and make sure Applies to shows =$A$7:$Z$1000 - or whatever column reference you choose in place of Z.
I've been searching around here but I can't find anything quite like what I'm after.
In excel I have one column with a drop down list of a dozen different initials, with conditional formatting on those cells. I would also like to format another column based on those initials, but don't want to set up a dozen rules on each cell, one by one. If I set up the top cell with the correct rules I cannot fill the formatting in because the formula is not updated on a row by row basis, but en bloc for the range.
I have no real experience with VBA or macro's, is there a way to do this more elegantly than brute force?
Thank you very much in advance. This forum has always been a great help, hopefully you can help this, too!
I hope I'm not misunderstanding your question. You can copy the formatting to the other columns if you have set up the format as a formula. For example, if A is your column with initials, and you have a data cell in B2, then you can set a formula in B2 as A2="ER", for example, with the formatting you want, and do the same for the rest of your matches on A2. Then, you can copy the format down column B (unfiltered) using Paste Special Format. You can copy the conditional formats across as long as you make sure that your format in the conditional formatting rule is anchored on column A (i.e., $A2="ER").
I've got some excel spreadsheets with a couple hundred to couple thousand rows. Each row represents a set of measurements taken at one second intervals.
I want to use the 3 color conditional formatting for each row. I can setup a single row for the 3 color by setting the "Applies to" to something like:
'Table1'!$B$2:$M$2
However, if i try to copy the format and then apply it to multiple rows, (say B3:M400), it will treat the entire block (all cells from B3 through M400) as a single conditional format, so each cell is colored according to all of the other cells. What i'm looking for is a way to apply the 3 color conditional formatting to each row individually over many many rows.
For example, in the image linked here: http://electriceptor.files.wordpress.com/2012/04/screen-shot-2012-04-30-at-11-53-36-pm.png (sorry, i'm too new to post images), each of the rows has an individual 3 color format that i manually applied to each row.
However, if i copy a single row and paste the format into that same block of 7 rows, it looks like this image: http://electriceptor.files.wordpress.com/2012/04/screen-shot-2012-04-30-at-11-56-42-pm.png:
Note how the formatting is applied to the entire block.
Is there a way to apply the conditional formatting for each row individually without doing each row manually?
Since 3-color conditional formatting doesn't accept relative references (no matter how much you try to 'trick' Excel with INDIRECT, ADDRESS, etc.), your best bet is to use the method here (example was for 2-color formatting): https://superuser.com/questions/350378/excel-2007-conditional-formatting-so-that-each-row-shows-low-values-yellow-hig
This is the same as using the format painter on each individual row (using the format painter on multiple rows puts you back to square one where it looks at all the rows).
Sub NewCF()
Range("B1:M1").Copy
For Each r In Selection.Rows
r.PasteSpecial (xlPasteFormats)
Next r
Application.CutCopyMode = False
End Sub
Also, there's no limit to the number of conditional formatting rules (at least in Excel 2010), but the more you have, the more potential there is for a negative impact on performance. You'll just have to try it and see. In the worst-case scenario, I would make 3-10 (or however many you can stand to make) individual rules based on a formula to create a "gradient", but this may be just as cpu-intensive.
I've just tried using the fill handle on a cell with conditional formatting e.g. =COUNTIF(C2,"Yes")=1 then applies to $A2 and then selected that cell and dragged the fill handle - it adds the conditional formatting to each row automatically! jippee!