Excel Conditional Formatting: Highlight cells if not equal - excel

I ran into a problem, where i want to highlight certain cells based on the input from another cell. Here is my quick example of what I would like to achive:
Highlight A1:A2 IF B1 does NOT contain the word "Reactor"
This is what is used and it did not work:
=IF(B1<>(search("Reactor",B1),"",""))
Any ideas how to overcome this little problem?Thank you!

A1 will be highlighted when:
=NOT(IFERROR(SEARCH("reactor",B1)>0,FALSE))
Probably this can be written in more beautiful way... But it works..

If you want more than one cell (A1:A2) to be triggered by a single cell (B1) you should anchor B1 (here B$1).
Since if SEARCH fails it will respond with an error, you should be able to apply:
=ISERROR(SEARCH("Reactor",B$1))
having selected A1:A2 first (or making that your Applies to range).

Related

Excel Formula If Cell Contains String

I'm currently working in excel, and I'm trying to figure out a way to find if multiple cells contain the string value of another cell, and if it does highlight the cell where the row and column meet up. I created an example of what I want, only it will be on a much larger scale.
I've tried using: =ISNUMBER(SEARCH(substring,text)) but I'm not quite sure how to use it the way I want to.
Any help will be appreciated!
Your approach is correct, we can use the fact that conditional formatting is applied like dragging a formula, adapting relative references.
Create a conditional formatting formula rule:
=ISNUMBER(SEARCH(B$1,$A2))
Applied to B2:D7
Your formula will work nicely; what you'll want to do is put that formula into all the cells you want to highlight, so you get FALSE and TRUE in every cell.
You'll then use two Conditional Formatting rules. The first will look for Cell Value = TRUE, and will set cell background and font colour to yellow. The second will look for Cell Value = FALSE, and will set cell background to No Colour and Font to White.
This will reproduce the result you're looking for.
Edited to add:
It is possible to do this using just Conditional Formatting too, but it's a little more fiddly. If you want to try it, you can do this:
Highlight your range, and take note of which cell is Active - that's the cell within your highlighted range that is still white. It's also the one whose address is shown in the Name box in the upper left. For the sake of this answer, we'll assume that's B2
Create a new Conditional Formatting rule. Choose "Use a formula to determine which cells to format".
Use the formula =ISNUMBER(SEARCH(B$1,$A2). Set the format to colour just the cell background.
Note where the $ appears in the formula above - you want to leave the row number anchored in the first part, and the column letter anchored in the second part.
This takes advantage of the fact that Conditional Formatting is able to use absolute, relative, and mixed references to find which cells to format. It's also a tidier solution, but it can be harder to maintain if the sheet is ever repurposed or modified.

Conditional Formatting rows with shared Merged Cell

I've got a little helper spreadsheet that I use, and there are some Merged Cells.
Rather than get rid of these, which I know can cause headaches, I was looking for an idea on fixing an issue.
I have a few rows that share a merged cell. When this merged cell is not empty, I want the rows to highlight. Currently, the formula (applied over A1:B4) is =$B1<>"" and then a fill. Works okay for the first row, but not the other three:
I was thinking I could add some more logic, but there's nothing really there for me. It's a pretty simple table. Unfortunately, there's not really a way to say (for rows 2:4), if row 1 is colored, then color this row...(Although I think I've seen clever uses of Named Ranges to do something like that, but I could be mistaken).
So, in A2, what's the conditional format formula "thinking"? Is it going to =$B2<>"", in which case ...what's it looking for as B2? If I select A2, and look at the conditional format rule applied to the current selection, it still shows =$B1<>"".
Thanks for any ideas/tips. It's not a huge deal, so I don't need a VBA solution - just maybe an idea or trick for using CF with merged cells.
Edit: For a more full explanation - the idea is that col. B will have an invoice number and if it's there, make the row a color. I will be repeating this "chart" a bunch, and have some non-grouped companies, who have their own lines. I just don't like the gap of color there in my group and was trying to get it to have a color when the first of the group does.
I usually try to base my CFR's on formulas.
    
After selecting all of column A and B I created a CF rule with the following.
=AND(LEN($A1), ISNUMBER(MATCH(1E+99, $B$1:$B1)))
The approximate MATCH function simply looks for the last number in the B column. I can see a missing invoice number in a cell like B7 would generate confusion but perhaps you can expand on this for conditions not demonstrated by your examples.
If you want to use "placeholder" instead of blank cells (when there is no invoice), you could try the following formula:
=(LOOKUP(2,1/($B$1:$B1<>""),$B$1:$B1)<>"x")*LEN(A1)
With sample data it looks like this:
When the cell is left blank (no placeholder), column A is highlighted, column B is not.

I want the last cell in a table to trigger a conditional format in excel (en masse)

Okay so I have a sheet of over 500 entries. Essentially when the pulldown menu I have placed in cell J matches the value in A$528(Set to YES) then columns A-I all have a pattern applied to them in that specific row.
What it ideally each line should look like is this:
Applies to: =$A$524:$I$524
Formula: =$J$524=$A$528
The problem is that when I had to go in and format these lines with the painter, the line Formula: =$J$524=$A$528 is Formula: =$J$2=$A$528 in all cases. =$J$2 stays completely static, I need it to progress based on which row it is in. I would really rather not have to go in and manually input these 500 numbers if at all possible.
Thanks in advance for any insight.
The reason why it stays static is that you use the dollar sign. If you want it to progress based on which row it is in, then just omit the dollar sign before the row. (As far as I understand your problem)
I agree question is not crystal clear but I think what you want may be a Conditional Formatting formula rule of:
=$J1=$A$528
with Applies to of:
=$A$1:$I$524
or maybe as above but with $J2 for $J1 and $A$2 for $A$1.
The trigger value might be hardcoded with the formula =$J1="YES" instead and then no need for YES in $A$528.

Using H-lookups in excel

I am searching through 1000's of lines of data and I'm looking for specific info in these cells and if it appears id like the end cell to have a tick in or turn red and ect. for easy distinguish.
So in short what I am looking for would be
All Selected cells
if (all cell a-z Contain "Admin"){
Tick cell AA
}
You should check for Admin inside a concatenation of the cells A1:Z1. This concatenation is achieved via A1&B1&C1&...&X1&Y1&Z1. So, for example, in cell AA1, enter
=IF(ISERROR(FIND("Admin",A1&B1&C1&...&X1&Y1&Z1)),"not found","found")
where you replace ... with the remaining cells in the range.
I have worked out a solution to the range issue instead of highlighting all of the cells
=IF(ISERROR(HLOOKUP("admin",A5:G5,1)),"NOT FOUND","FOUND")
Hope this helps anyone else out there.
One way of doing this is as follows. In the cell you want the indicator have the following code, and assuming that you are looking for the value a - replace "a" with the value you are looking for.
=COUNTIF(D8:I8,"a")
You can then use conditional formating that says if the cell is > 0 then turn it red, or have an adjacent field that has a conditional format to put in a traffic light, tick mark, whatever and hide the previous field.
Hope this helps

Checking cell value dynamically

What I'm doing is a simple map on one tab of an office space that has all the cubicals laid out. On this map, I have conditional formatting checking another table of listen computers for the last time they were updated/maintained. It works as it stands, but we are moving into a new building and the map (which is already done) has WAY more cubes than last time. So I'm trying to figure out a more efficient way to do this task.
Here is the code:
=AND(VLOOKUP("CCA C1",LOCATION,3,FALSE)<>"",VLOOKUP("CCA C1",LOCATION,3,FALSE)<TODAY()-80)
So as it sits, it works fine. But what I'm trying to do is change the "CCA C1" to simply read the contents of the cell it's formatting so I can just format an entire range of cells rather than doing it cell by cell. The "CCA C1" is in the location of the second sheet (it's a named range). So this checks that entire range for "CCA C1" and checks if the date a couple columns over in that row is within 80 days, if it's not it highlights the cell in the map in red reminding us we need to check the computer. But what I would like to do is simply put "CCA C1" in the cell in the map (which is already is labeled), and have this check for the value of the cell it's formatting and look for that value the same way it's looking now. Just without me having to put "CCA C1" in the formula, I'd like to say something like this:
=AND(VLOOKUP(CURRENT CELL VALUE,LOCATION,3,FALSE)<>"",VLOOKUP(CURRENT CELL VALUE,LOCATION,3,FALSE)<TODAY()-80)
Make sense? Anyone know of a way to do this? Otherwise I have to conditionally format each individual cell with the value manually rather than just format all the cells with the same formatting and have the formula check the contents of the cell for what to look for in the location range of the other sheet.
And to clarify, I know that I can put in the actual cell, such as E3, but then I still have to manually change the formula for each cell which defeats the purpose. I want to just say current cell or something like that. I have 3 conditional formats for each cell, I have around 100 cells to be formatted, so rather than having 300 formats I have to put in, I'd love to just do 3. Not sure if this is possible, that's why I'm asking :)
Just replace "CCA C1" with the address of the first cell in the range of cells with the conditional formatting. Assuming your conditional formatting starts in B2:
=AND(VLOOKUP(B2,LOCATION,3,FALSE)<>"",VLOOKUP("CCA C1",LOCATION,3,FALSE)<TODAY()-80)
EDIT: As I commented, I'm not sure I understand the issue, but if I do, you need to enter the range of cells with CF in the applies to range of the CF dialog, rather than copying and using Paste Special:
Note that this works with the merged cells.
You will need to adjust the applies to range as you add more computers, etc., but the same formula will work.

Resources