I have a sheet with 10k+ rows that I get every day. I have about 50 formulae that I run against this sheet to count certain occurrences, and example of this is
=COUNTIFS(B:B,"*.jpg")
But as well as returning the totals I want the sheet to highlight every row that has been counted.
I thought I could maybe to that with conditional formatting but I cannot get it to work.
Thanks for any advice.
I have attached a snap shot of an example sheet where the rows are colour banded using conditional formatting.
The rule I used to validate if formatting applies has to equate to TRUE. I test my rule off to the side in cell E1 in this case. I can also copy it across to make sure I have the $ in the right spot. When its doing what I want and evaluating to TRUE or FALSE in the right spots, I edit the cell and copy the formula. I then highlight the range I want to apply it to, in this case A1 to B7 (though technically we can adjust later), and I make sure that A1 is the active cell in the selection. Then I go to the Home Ribbon and select conditional formatting and get the pop up window below:
You can select all the formatting options for when things are true by left clicking the "Format..." button.
As per Tim's s comment, select the last one from the rule type list "Use a formula...". in the blank bar below paste your rule that will equate to TRUE or FALSE. so in our case the rule I used was:
=ISNUMBER(SEARCH($C$1,$A1))
Basically I am doing a non case sensitive search in cell A for the criteria in C. IF cell A1 has it, it will return a number. ISNUMBER will check that its a number and return TRUE. If it could not find C1 in cell A1 then it would return an error and ISNUMBER would come out false.
Finally we can see where the rule will apply. So if you have 10K rows, it may be easier to simply type in the number of the last row here instead of selecting it manually, though that would still work.
I created 1 colouring rule for each file type I was searching for.
UPDATE
I am not familiar with how your internal array of {"File","VALID"} works, but I am going to assume that you want to count them if column D is equal to one OR the other AND column F is equal to "G_NOT". In this case since those are the only words in the appropriate cell I will not use the search method and instead just use the following as your formula rule for conditional formatting:
=AND($F1="G_NOT",OR($D1="FILE",$D1="VALID"))
This assumes there is no header row and your data starts in row 1. If you have a header row change change those 1 to 2. Have your left most Cell to your right most cell selected with the left most cell being the active cell. Then go into your conditional formatting. When you are done you can manage your rules, and adjust your range to go to the last row.
Related
I have a spreadsheet that has the following columns:
Tactic, Impressions, Engagement, Clicks and Forms. The tactic column contains a dropdown menu on each cell that has x amount values, for simplicity lets say it has 2, Value1= "A" and value2= "B".
if cell A1(where the Tactic column is) contains the value "A" then I want to highlight in say "Yellow" colour the adjacent cells of the Impressions and Engagement columns and if the value of cell A1 is "B" I want to highlight the adjacent cell of teh Forms colum in yellow but not any other column.
Basically, I need to be able to select a Tactic and the columns that require data to be entered based on that tactic to be highlighted to the user. And this needs to be applied to x number of rows in the spreadsheet?
I can accomplish this partially by using conditional formatting and using a custom formula. please see picture below but the problem is that the rule only applies to that particular range, in this case E2-F2. I need excel to "Know" that when the value of the Tactic column in any row changes or it is filled up for the adjacent cells to be highlighted based on the formula.
Is there a way to make this conditional formatting dynamically obtain the row index where the Tactic selection was made and apply the cell colour to columns E and F but only on the row where the selection was made without having to hardcode each row with this conditional formatting?
Thanks for your help!
On "Formula" use =$D2="A"
On "Applies to" select the whole Column-Area
This should do the trick
You want one set of cells across the row highlighted on condition A and a different set of rows highlighted for condition B.
You will solve this by creating TWO rules.
Rule "A" is the =$D2="A" rule, with an applies to range that is the rows you want to highlight for condition "A".
Then click "New Rule" and add =$D2="B" and make the applies to range only the column you want to highlight on condition "B".
You can just keep on going and adding a condition C, D, E, etc... one new rule in the rule manager for each cell highlight combination.
The rules are applied in order, so in some cases where a row may meet more than one condition, you'll need to move the rules to be in a specific order and check the Stop if True box. This creates an "If/elseif/elseif..." structure.
But in your use case, a row can only trigger one of A or B conditions, so there's no sequencing necessary.
Conditional formatting can be counter-intuitive. In Excel we have to change our thinking away from a procedural approach to a fully object-oriented approach. We don't "send" values to a cell, rather, we can only tell the cell, by the means of its formula, how to determine its own value. But in conditional formatting we have to go back to some procedural thinking in the way we develop the conditional logic.
I'm trying to do conditional highlighting for a given row.
If a specific cell in a row isn't blank, then I want more highlighting to be done on the row;
If (1) is true, then I want each cell in that row which isn't blank to be filled with the same color.
One important factor is that I have functions which return no values, making the cell appear blank (e.g. ""). These cells should be highlighted if (1) is true. Because of this I have been using the length function LEN() to determine if a cell is empty as ISBLANK() won't work.
The current highlighting rule I am using is:
=AND(LEN(E274)<>0,LEN($F$274:$U$274)=0)
I am stuck on what to put in the Applies to box. Currently it just selects one cell.
My main problem is replicating the formula over each given column in the row without creating tons of rules. Then if possible I want to do the same thing for about 200 rows.
Suppose you want to highlight something in A1:h18, and the specific cell ist always in column then (if i understand you right)
1. mark a1:h18
2. and use the following formula
=AND(LEN($a1)<>0,LEN(a1)<>0)
I have several columns where the data from rows 7 onwards changes depending on the selection made from a dropdown menu in row 6. Most of these options will result in textual or number based values appearing, but two of them would need to be formatted as currency.
Essentially what I want is a conditional formatting formula that says; if row six in any column has a value of “Implied Unit Rate” or “Annual budget”, format rows 7 and onwards in that column as currency.
I can get this to work by creating two separate conditional formatting formulas and applying them both to the whole area, but it seems like there should be a way to do it in a single formula.
My current formulas, applied as two separate rules:
=INDIRECT(ADDRESS(6,COLUMN(),1))="Annual Budget"
=INDIRECT(ADDRESS(6,COLUMN(),1))="Implied Unit Rate"
How I think it should work when applied as one rule:
=OR(INDIRECT(ADDRESS(6,COLUMN(),1))="Annual Budget",
INDIRECT(ADDRESS(6,COLUMN(),1))="Implied Unit Rate")
When I enter the combined formula in a regular cell within the worksheet, it does return true as expected, but does nothing when I apply it as a conditional formatting rule. Any ideas? Thanks in advance!
Now I may be mis interpreting what Scott is saying, so I am going to say this in my own words.
Your condition check on the cell address in question is a little "verbose". In order to apply your conditional formatting, select the range you want to apply your condition formatting to first. Lets arbitrarily say select range A7 to D42. After selecting the appropriate range, ensure cell A7 is the active cell of the selected range. This usually means there is a border around A7 to D42 and all cells but A7 have been slightly greyed to indicate that they have been selected, and A7 will have a brighter background to indicate that it is the active cell. With all that still in effect, select your conditional formatting.
In conditional formatting choose formula as the option (last one at the bottom) to control how your formatting will be applied. In the region where you can enter your formula, enter the following:
=OR(A$6="Annual Budget", A$6="Implied Unit Rate")
The $ will keep the row and column reference from changing as it is applied to each cell in the range. It will always be checking row 6 of what ever column the cell is in. The column A reference is relative to the active cell.
I'm trying to apply conditional formatting in Excel on a range of cells, based on the adjacent cell's value, to achieve something like this:
The goal is to highlight values in Column B (Actual Expense) red if the value is greater than it's adjacent value in column C (Expected Expense). I've followed a number of tutorials that said to apply conditional formatting by selecting Conditional Formatting>New Rules>Use a Formula to Determine Which Cells to Format then applying a rule =$B4>$C4 which would format the 'Actual' cell red if it were greater than the 'Expected' cell. This works great for one cell, but not so well when I attempt to apply this to a range of cells. I've used the format painter as well as editing the rule to be applied over a range of cells (i.e. $B$2:$B$5) as shown below but it only bases the formatting on the initial formula (if B4 is greater than C4) and everything undesirably turns red.
I'd rather not make individual rules for every row. Is there a way to consolidate this into one rule?
You need to take out the $ signs before the row numbers in the formula....and the row number used in the formula should correspond to the first row of data, so if you are applying this to the ("applies to") range $B$2:$B$5 it must be this formula
=$B2>$C2
by using that "relative" version rather than your "absolute" one Excel (implicitly) adjusts the formula for each row in the range, as if you were copying the formula down
I don't know if maybe it's a difference in Excel version but this question is 6 years old and the accepted answer didn't help me so this is what I figured out:
Under Conditional Formatting > Manage Rules:
Make a new rule with "Use a formula to determine which cells to format"
Make your rule, but put a dollar sign only in front of the letter: $A2<$B2
Under "Applies to", Manually select the second column (It would not work for me if I changed the value in the box, it just kept snapping back to what was already there), so it looks like $B$2:$B$100 (assuming you have 100 rows)
This worked for me in Excel 2016.
So I've got a cell that I'd like to colour orange if the date in that cell (lets say that cell is C1) is later than a date in a cell (lets say B1) somewhere on that same row. I can conditional format C1 to do this. All good. But then I'd like to create an indeterminate amount of rows like this. The two dates which I want to compare are in the same column in every row, but are compared per row. So one date in C1 will compare to B1. Another in C2 will compare to B2. There doesn't seem to be a conditional formatting technique to achieve this. Help?
P.s: A few things I've tried is using If statements but I can't seem to work out how to do it. I've also tried conditionally formatting one row and then using "insert" to replicate the condition formatting of the row above it but this seems to start comparing the inserted row to the date in the row above...
In order to apply conditional formatting to a range you can select the range first (and then that range will automatically become the "applies to" range in conditional formatting)
....then set the formula that applies to the first row of that range only
....then select appropriate formatting
As long as the formula uses the correct relative references that's sufficient to make it work for the entire range
So in your specific case you can select the whole column, or a specific range like C1:C100 and then apply the formula that you need for the first row of that range, i.e.
=C1>B1
Another way to achieve this is to apply the formula to the first row only (as you have done already) then click on "format painter" (the little brush on the Home ribbon)......then select the range to copy to (e.g. C2:C100)