Excel Highlight one row based on another - excel

I am trying to compare one row with another: IF the cells in Row 1 is equal to Row 2, THEN I must have highlighting. I've tried 100 methods for over an hour now. The problem is that Excel keeps the formula the same across the row!! the formula needs to change, meaning: I am NOT trying to highlight the whole row based on just the first cell, the cell needs to dynamically change. First cell to first cell, 2nd to 2nd, etc.
The circled words need to be highlighted.
Sorry to ensure everyone is clear on the requirement, here is my requirement:
The solution, as a brilliant guy below mentioned, was a stupid $ sign.

If you want the circled words to be highlighted, the "Applies To" field should be "=$A$10,$E$10" - to see what rules are being applied in those cells, they need to be part of the current selection or you need to change the selection in "Show Formatting Rules For" to "This Worksheet."
If you want the comparison to not be absolute, remove the dollar signs.
Also consider adding TRIM() around A9 and A10 in the formula if you don't want stray spaces to lead to a detection of a difference.

change the Formula to = A10 = A9 (or just remove the $'s in yours) and Applies To =$A$10:$E$10

Related

how do I compare each row of two different columns and highlight the highest value (not formula) in each row?

I have two columns to compare. All cell values come from the ROUNDUP function. =ROUNDUP(C6/D12,0) etc.
I want the larger, or equal, of the two in each row to be green and the smaller red. Using the formula, it does not work as expected. If I do the same with numbers typed, not the formula, it works. It appears the formatting applies to the formula and not the value.
That is the first half of the problem. I also want to autofill/paint the conditional formatting to numerous cells, but it always compares to the top left cell, rather than the two cells on the same row.
If I use the color scales formatting it works, but I do not want the scales, just red/green.
It seems hard to believe that what I want to do is not possible. Can someone please help me with this. Thanks in advance.
In conditional formatting, under 'use a formula to determine which cells to format', you need to enter
=A2=MAX($A2,$B2)
to highlight the larger cell and (as a separate rule)
=A2=MIN($A2,$B2)
to highlight the smaller cell.
Note that in the case where both cells have the same value, they will both be either coloured red or green depending on the precedence of the rules. If the 'green' rule comes first,
it will look like this:
Conditional formatting is almost its own little science within Excel. It may be more useful to find youtube tutorials on the topic than depend on a text explanation here. But the central theme is this.
You will use location locking (the dollar sign or F4) in front of the letters so that any cell to which the format is applied knows you specifically mean columns E and F, for instance.
Example: Assume your first row goes from A5 to M5, and the condition values are in E5 and F5.
I find it easiest to format one row with the rules I want, test them, and then use the format painter or copy -> paste format along with careful use of $ locking.
Drag over and select the entire row of cells A5:M5
Conditional Formatting -> New Rule -> Use a formula to determine which cells to format
In the formula field enter =$E5>$F5. Excel gets weird and often inserts double quotes. If you save the rule and go back in, it may say ="$E5>$F5" and if so delete the double quotes.
Click Format and create the cell format you want.
With A5:M5 still selected, add another rule and format for ="$E5<$F5"
The $ sign works the same way as it does in a formula. All of the columns get their format based on columns E and F, but all of the rows base their formula on the E and F values in that same row.

Using IF and conditional formatting

I'm trying to have a cell becoming highlighted if it satisfies two criteria.
I would like the cells below each Staff column to be purple if its both the same as the version# and contains *.
I've managed to highlight cells containing the * by using "highlight if cells contain" ~* but I can't get it to do both.
I've tried
=AND(L2=$J2,"~*")
=AND($J2,"~*")
=IF(AND(L2=$J2,"~*"))
(Version# is column J, Staff 1 is column L)
Answer by BigBen
If the Staff # contains an asterisk, will it always immediately follow the version #? If so you could just do
=L2=$J2&"*"
Seeing what I think you want, the main issue is the asterisk. When you enter a number in a cell and also enter a non-numerical character the cell automatically becomes formatted as TEXT. It is possible to extract the numerical value with a formula, but handling what you want is much easier if you separate the number from the asterisk. In my included example (You should be able to open it in a new tab on your browser) created narrow columns after each 'staff#' column to accept the asterisk entry.
This done, enter the three conditional formats as shown (in C2 in the example). You then copy the C2 cell into each of the cells under the Staff# columns. That produced the results shown which I think is what you want. Changing entries will produce the proper formatting results for that cell.

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

Resources